okay the full code is;
Sub macro222()
Range("A2:w43").Select
Selection.Copy
Dim i As Long
For i = 45 To 90000 Step 43
If Range("A" & i).Value = "" Then Exit For
Next i
Range("A" & i).Select
'Selection.Copy
ActiveSheet.Paste
ActiveCell.Select
Application.CutCopyMode = True
ActiveCell.Offset(0, 0).Select
ActiveCell.Offset(24, 0).EntireRow.Hidden = True
ActiveCell.Offset(26, 0).EntireRow.Hidden = True
ActiveCell.Offset(28, 0).EntireRow.Hidden = True
ActiveCell.Offset(30, 0).EntireRow.Hidden = True
ActiveCell.Offset(32, 0).EntireRow.Hidden = True
ActiveCell.Offset(34, 0).EntireRow.Hidden = True
Sheets("Data").Activate
Set myR = Range("B7")
i = 0
Do Until myR.Offset(i, 0).Value = ""
myR.Offset((i + 1), 0).Select
Selection.Copy
Sheets("Profile").Activate
ActiveSheet.Paste
Sheets("Data").Activate
i = i + 1
Loop
End Sub
I am copying a series of discriptions {Range("A2:w43")} in the "profiling" tab that are assigned via a VLOOKUP function and pasting them 43 cell down.
The lookup value should be placed in cell A2. To save me manually entering this value 100's of time im trying to create acode that will copy the lookup values which begin in cell B7 on the data tab and copy them into cell A2 on the profiling tab.
I beleive that as the cell A2 is active when the range A2:W43 is copied that it is not neccessary to account for the paste location moving down the spreadsheet (the 43 step accounts for this, i think [at least it has so far]).