Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Creating a Copy/Paste Loop

Thank you so much!! Now I understand the concept!!!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy paste loop---new to vba MFR Excel Programming 4 October 26th 06 08:25 PM
Copy and Paste Loop japorms[_17_] Excel Programming 2 July 19th 06 09:07 PM
Creating Loop to Paste Array Nate Excel Programming 1 January 5th 06 03:59 AM
Copy/Paste Loop Jelly''s Excel Programming 0 December 6th 05 10:10 PM
copy and paste loop Dillonstar[_5_] Excel Programming 1 December 11th 03 04:22 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"