Forum Discussion
Tyler Dyer
May 31, 2018Copper Contributor
Getting Macro to loop and get the range to change each time
Hi! I hope you can help! I recorded a macro and I want to edit it to make it work for my purposes. I want the macro to copy a row of cells into a specific location. Then have the macro copy my result...
Logaraj Sekar
Jun 01, 2018Iron Contributor
Hi Tyler Dyer
For X = 129 To 130
Range("C" & X & ":L" & X).Select
Selection.Copy
Range("B121").Select
ActiveSheet.Paste
Range("M120:R120").Select
Application.CutCopyMode = False
Selection.Copy
Range("N" & X).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Next X
Tyler Dyer
Jun 01, 2018Copper Contributor
Ooooohh! That's now you combine the location and the variable. I was trying like "C" + x blah blah. But you have to use the &. Thanks so much! Works perfectly!