How can I use VBA in Excel to determine the maximum / minimum range containing error cells, such as #N/A or empty cells? I know this is a fairly simple task - to conquer Excel formulas using something like =MIN(IF(A1:A10="#N/A"))
#N/A
=MIN(IF(A1:A10="#N/A"))
but I would really like to do this using VBA.
I am dealing with several thousand rows of data, so it would be the fastest solution.
Thank you very much!
You can use Evaluate or a shortcut [] to return the equivalent of a VBA formula
Evaluate
[]
So the Excel array formula=MIN(IF(NOT(ISNA(A1:A10)),A1:A10)) can be used in type code
=MIN(IF(NOT(ISNA(A1:A10)),A1:A10))
Sub Test() MsgBox [MIN(IF(NOT(ISNA(A1:A10)),A1:A10))] End Sub
Source: https://habr.com/ru/post/1433085/More articles:PHP Table: I am trying to create a new row for each row of the mysql table in my website - htmlA chain of dynamically created dropdowns using jQuery - javascriptCommon Lisp: how to access a string of a specific multidimensional array? - common-lispJPanel with ComponentListener - javaJava Swingworker Thread - javaGetting the kids collection for the parent model. HttpPost Update - c #Action bar removes name and frees up space - androidHow to find out the default server character set in mysql? - mysqlCoin Flip Program - javaNSNumber doubleValue returns NaN - objective-cAll Articles