Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a Copy/Paste Loop
Hello all! I'm brand new to macros and VBA. I've searched
everywhere, but can't seem to come up with a solution for this simple task. I have 45 rows x 4 columns worth of data that need to be copied down in 51 row increments (no column movement). Right now I'm using the code below and it works once, but I need to highlight the newly created cell and repeat manually. The last row to paste the selection on is 1565. I have no idea how to make it loop. Any help would be greatly appreciated! ActiveCell.Resize(45, 4).Copy.ActiveCell.Offset(51, 0) Application.CopyCutMode = False |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a Copy/Paste Loop
This will go to row 1575.
Sub cpy51() lstRw = Cells(Rows.Count, 1).End(xlUp).Row Do Until lstRw = 1565 ActiveCell.Resize(45, 4).Copy ActiveCell.Offset(51, 0) lstRw = lstRw + 51 Range("A" & lstRw - 44).Activate Loop End Sub " wrote: Hello all! I'm brand new to macros and VBA. I've searched everywhere, but can't seem to come up with a solution for this simple task. I have 45 rows x 4 columns worth of data that need to be copied down in 51 row increments (no column movement). Right now I'm using the code below and it works once, but I need to highlight the newly created cell and repeat manually. The last row to paste the selection on is 1565. I have no idea how to make it loop. Any help would be greatly appreciated! ActiveCell.Resize(45, 4).Copy.ActiveCell.Offset(51, 0) Application.CopyCutMode = False |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a Copy/Paste Loop
Thank you so much!! Now I understand the concept!!!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy paste loop---new to vba | Excel Programming | |||
Copy and Paste Loop | Excel Programming | |||
Creating Loop to Paste Array | Excel Programming | |||
Copy/Paste Loop | Excel Programming | |||
copy and paste loop | Excel Programming |