ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Loop (https://www.excelbanter.com/excel-programming/446431-macro-loop.html)

BadMammaJ

Macro Loop
 
I need some help. I am trying to get my macro code to loop over multiple lines to the end of my worksheet.

I have started with this code so far
Code:

Range("A2:F2").Select
    Selection.Copy
    Range("A3:F48").Select
    Selection.Insert Shift:=xlDown
    Sheets("Sheet6").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Sheet7").Select
    Range("G2").Select
    ActiveSheet.Paste
    ActiveWindow.SmallScroll Down:=27
End Sub

I need this to loop from the top to the bottom, but not sure how that would work because by the time this runs, I'm 47 lines down from where I started. I'm new to macros. If I can get this to work, it will save me a month's worth of work.

Thanks


All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com