Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default copy/inserting rows at specific intervals

I need to let a user input a number corresponding to the
number of samples (e.g., 1-5).

TO do this I plan on copying a series of rows (acting as a
template) for example 4-9 and then paste this in starting
at row 10 for each sample. So I would have identical rows
starting at 4, 10, 15, etc (based on the user input)

I can capture the user input and copy the 'template' rows
with no problem. My question is how do I 'insert copies'
at specific rows multiple times?

Thanks for your help - Mark.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default copy/inserting rows at specific intervals

Mark

Something like this, I think

Sub MakeTemplate()

Dim NoOfCopies As Long
Dim i As Long

NoOfCopies = Application.InputBox("Enter number of samples")

For i = 10 To (NoOfCopies * 5 + 5) Step 5
Range("A4:A8").EntireRow.Copy
Range("a" & i).Resize(5).EntireRow.PasteSpecial
Next i

Application.CutCopyMode = False

End Sub
--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"mark" wrote in message
...
I need to let a user input a number corresponding to the
number of samples (e.g., 1-5).

TO do this I plan on copying a series of rows (acting as a
template) for example 4-9 and then paste this in starting
at row 10 for each sample. So I would have identical rows
starting at 4, 10, 15, etc (based on the user input)

I can capture the user input and copy the 'template' rows
with no problem. My question is how do I 'insert copies'
at specific rows multiple times?

Thanks for your help - Mark.



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
Inserting numerous blank lines between specific rows of data Deb Excel Discussion (Misc queries) 5 December 22nd 09 05:01 PM
Copy Formulas when inserting rows kevhatch Excel Discussion (Misc queries) 1 February 27th 07 01:33 PM
INserting Specific Number of Rows via macro [email protected] Links and Linking in Excel 1 November 14th 06 09:56 PM
When Inserting Rows in Excel, not all formulas copy to new row? dannyboy Excel Discussion (Misc queries) 2 September 27th 06 10:35 PM
inserting specific # of rows cwinters Excel Discussion (Misc queries) 1 June 6th 05 07:30 PM


All times are GMT +1. The time now is 01:06 PM.

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

About Us

"It's about Microsoft Excel"