macro to copy cells to intermittent rows in a spreadsheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

im trying to copy formulas from cells h,i, and j in row 2 to
the same cells in rows 52,102,152,202,252,302,etc.... up to row 49902
i thought a macro could do the trick but im having a hard time with the
language
any help or ideas would be greatly appreciated
thank you
brock
spokane, wa
 
Sub thishere()
hForm = Range("H2").Formula
iForm = Range("A2").Formula
jForm = Range("J2").Formula
For i = 52 To 49902 Step 50
Cells(i, 8).Formula = hForm
Cells(i, 9).Formula = iForm
Cells(i, 10).Formula = jForm
Next i
End Sub
 
try testing this and then just change the step 3 to whatever is desired such
as 52
Sub copymodrows()
For i = 1 To 12 Step 3
Range("h1").Resize(, 3).Copy Cells(i, "h")
Next
End Sub
 
You will also want to change the 12 to whatever desired.
Sub copymodrows()

maybe use a variable to determine the last row

lr-cells(rows.count,"h").end(xlup).row
for i= 1 to lr step 52
 
Hi,

Try this:

Sub cpyr()
Range("H2:J2").Select
Selection.Copy
For i = 52 To 49902 Step 50
Range("H" & Trim(Str(i))).Select
ActiveSheet.Paste
Next i
End Sub
 
thank you all for ur help

Don Guillett said:
You will also want to change the 12 to whatever desired.
Sub copymodrows()

maybe use a variable to determine the last row

lr-cells(rows.count,"h").end(xlup).row
for i= 1 to lr step 52



--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
 
Back
Top