I'm having troubles with a For Each ... Next loop.
I'm not sure how much of my code I should post so I'll start on the lean side and if anyone needs more context - just ask.
The error message is "Run-time error '13': Type mismatch", generated by the second line I posted.
I have a hunch the error is coming from the cell.value section.
If anyone can shed light on the situation, please let me know.
Thanks.
Straws
I'm not sure how much of my code I should post so I'll start on the lean side and if anyone needs more context - just ask.
Code:
For Each cell In Sheets("database").Columns("A")
If cell.Value = TextBox7.Text Then
n = n + 1
If n > UBound(a, 2) Then ReDim Preserve a(1 To 8, 0 To n)
a(1, n) = cell.Row
End If
Next
The error message is "Run-time error '13': Type mismatch", generated by the second line I posted.
I have a hunch the error is coming from the cell.value section.
If anyone can shed light on the situation, please let me know.
Thanks.
Straws