HI, I am brand new to writing macros and am just learning on the fly right now. I recorded a macro that I am now trying to loop. I will have up to 1000 rows of data that I need to run through my file and produce out put from. Below is the macro I currently have:
Rows("3:3").Select
Selection.Copy
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Variance").Select
Application.CutCopyMode = False
Sheets("Variance").Copy Before:=Sheets(1)
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Output").Select
End Sub
This is taking Row 3 on my "Output" tab and copying it to Row 2. Row 2 then feeds calculations in the file and produces a "Variance" tab which I am copying as a new tab and pasting values only. I then go back and copy Row 4 on the "Output" tab and paste it in Row 2- calculations run - I get my variance output - save it and then go on down the list. I've been able to modify the code to work EXCEPT I can't get it to move from Row 3 to Row 4 and so on. I know this is probably something obvious, but I'm struggling. I pasted the clean "recorded" code above instead of my attempts. Thanks!
Rows("3:3").Select
Selection.Copy
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Variance").Select
Application.CutCopyMode = False
Sheets("Variance").Copy Before:=Sheets(1)
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Output").Select
End Sub
This is taking Row 3 on my "Output" tab and copying it to Row 2. Row 2 then feeds calculations in the file and produces a "Variance" tab which I am copying as a new tab and pasting values only. I then go back and copy Row 4 on the "Output" tab and paste it in Row 2- calculations run - I get my variance output - save it and then go on down the list. I've been able to modify the code to work EXCEPT I can't get it to move from Row 3 to Row 4 and so on. I know this is probably something obvious, but I'm struggling. I pasted the clean "recorded" code above instead of my attempts. Thanks!