![]() |
macro to copy cells to intermittent rows in a spreadsheet
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 |
macro to copy cells to intermittent rows in a spreadsheet
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 BROCK8292 wrote: 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 |
macro to copy cells to intermittent rows in a spreadsheet
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 -- Don Guillett Microsoft MVP Excel SalesAid Software "BROCK8292" wrote in message ... 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 |
macro to copy cells to intermittent rows in a spreadsheet
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 -- Farhad Hodjat "BROCK8292" wrote: 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 |
macro to copy cells to intermittent rows in a spreadsheet
thank you all for ur help
"Don Guillett" wrote: 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 For i = 1 To 12 Step 3 Range("h1").Resize(, 3).Copy Cells(i, "h") Next End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Don Guillett" wrote in message ... 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 -- Don Guillett Microsoft MVP Excel SalesAid Software "BROCK8292" wrote in message ... 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 |
All times are GMT +1. The time now is 12:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com