Hi,
can anyone tell me where the problem is with the code below.
Blocks of 1's, 2's are spaced over 200 rows ('1' is A1:A200 etc)
Cursor should move to find the first occurrence of a '1' in Column A in response to a '1' in first text box of my Userform, then move 2 columns to right (to C1)
Cursor should move to find the first occurrence of a '2' in Column A in response to a '2' in first text box of my Userform then move 2 columns to right (to C201)
Cursor should move to find the first occurrence of a '100' in Column A in response to a '99' in first text box of my Userform then move 2 columns to right (to C19801)
Many thanks
can anyone tell me where the problem is with the code below.
Blocks of 1's, 2's are spaced over 200 rows ('1' is A1:A200 etc)
Cursor should move to find the first occurrence of a '1' in Column A in response to a '1' in first text box of my Userform, then move 2 columns to right (to C1)
Cursor should move to find the first occurrence of a '2' in Column A in response to a '2' in first text box of my Userform then move 2 columns to right (to C201)
Cursor should move to find the first occurrence of a '100' in Column A in response to a '99' in first text box of my Userform then move 2 columns to right (to C19801)
Many thanks
Code:
Sub TestPointer()
Dim y As Integer
Dim ptr As Integer
Dim myRow As Long:confused: ' (why does mnRow not appear in the code below?)
y = 100
ptr = 0
'y = 1 goes a C1
'y = 2 goest to C201
'....
'y = 99 goes to C19801
'y = 100 goes to C20001
Do While ptr <= y
Range("C" & ptr * 200 + 1).Select
'your code to do whatever with the
'data at that point
ptr = ptr + 1
Loop
End Sub
Last edited: