I am looking for a way to count a non-empty element in an array of sizes.
I read the solution here. VBA counts non-empty array elements . However, I think there may be a better way or function to execute it.
To count non-empty cells in a range (A1: J10), we use this in Excel VBA
k = Application.WorksheetFunction.CountA(Range(Cells(1, 1), Cells(10, 10)))
I am looking for a similar function to count non-empty elements in an array. For example, I tried this
k = Application.WorksheetFunction.CountA(Array(1,1),Array(10,10))
But that will not work. Is there such a function for counting a non-empty element in an array?
I need to calculate this because I would like to delete whole rows in an array when all elements from the same rows in the array are empty.
Thank.