Hi People.
I was wondering why the following code is erroring out:
For I = 2 To 8
For J = 3 To LastRowColA
If PBNum = Sheet1.Range(Cells(I, J), Cells(I, J)) Then 'ERROR LINE
Counter = Counter + 1
End If
Next J
Next I
I am trying to reference a single cell at a time which works when I put in the numbers Sheet1.Range(Cells(1,2), Cells(1,2)), I need to change columns and rows hence the need of a couple of For loops.
The command doesn't seem to want to accept column or row #s as arguments.
Any suggestions?
Thanks in advance, DAVE
I was wondering why the following code is erroring out:
For I = 2 To 8
For J = 3 To LastRowColA
If PBNum = Sheet1.Range(Cells(I, J), Cells(I, J)) Then 'ERROR LINE
Counter = Counter + 1
End If
Next J
Next I
I am trying to reference a single cell at a time which works when I put in the numbers Sheet1.Range(Cells(1,2), Cells(1,2)), I need to change columns and rows hence the need of a couple of For loops.
The command doesn't seem to want to accept column or row #s as arguments.
Any suggestions?
Thanks in advance, DAVE