Using variables (maybe?) to go through rows.
Posted by Chris Whisonant on September 11, 2000 6:39 PM
Ok, here is my macro:
Range("D1:D23").Select
Selection.Copy
Range("G1").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
End Sub
What I need to do is have the row number as a variable (or other solution you could help with). The "D" column represents the hours in a day (1-23) and I have over 18,000 rows to analyze! A While loop or something to that effect seemed the probability and I would start with
X = 1
While X < 19000
Range("D(X):D(X+22)").Select
Selection.Copy
Range("G(X)").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
X = X + 23
Wend
End Sub
This, of course, does not work. I am hoping that this has been enough information for someone to see what I'm at least trying to go for.
Any help is greatly appreciated,
Chris