View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
AA2e72E AA2e72E is offline
external usenet poster
 
Posts: 400
Default Counting Strings in an Array

Given an array, you want to count the numberof rows that are NOT empty:
correct?

Try:

Function xx(ByVal StringArray As Variant) As Integer
StringArray = Join(StringArray, ",")
While 0 < InStr(StringArray, ",,")
StringArray = Replace(StringArray, ",,", ",")
Wend
StringArray = Split(StringArray, ",")
xx = UBound(StringArray)
End Function

"ExcelMonkey" wrote:

How do you count strings within an array?

Thanks