"KR" wrote:
> If FoundMatch =N/A then
> 'go ahead and add all my strings
> End if
>
> p.s., since I know I'll be asking in my next post anyway... what is the
> proper way to describe "N/A" in VBA, per the first line of the If statement
> above? Should it be in quotes? I remember from another post (a long time
> ago) that it was something not immediately obvious or intuitive...
>
KR,
"=NA()" is the way #NA is defined in a cell. You could try the following
methodolgy. I tested it with =NA(), letters, and numbers in the cells that
are inserted into the DataArray and the CriteriaArray. The methodolgy did
not work if .Cells( i, DataCol).Value was used instead of .Cells( i,
DataCol).Text
..
..
Dim NumDataRows As Long, NumCriRows As Long
Dim DataArray() As String
Dim CriteriaArray() As String
Dim CountArray() As Single
Dim ThisSheet As String
ThisSheet = ActiveSheet.Name
Worksheets(ThisSheet).Activate
For i = 1 To NumDataRows
DataArray(i) = Worksheets(ThisSheet).Cells( i, DataCol).Text
Next i
For j = 1 To NumCriRows
CriteriaArray(j) = Worksheets(ThisSheet).Cells( j, CriCol).Text
Next j
For j = 1 To NumCriRows
cntr = 0
For i = 1 To NumDataRows
If (DataArray(i) = CriteriaArray(j)) Then
cntr = cntr + 1
' whatever else you want to do.......
End If
Next i
CountArray(j, 1) = cntr
Next j
..
..
HTH,
Raul
Bookmarks