Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to copy two areas of my spreadsheet and insert those two
areas "X" number of times. I am novice with VBA and tried to take two strings of code I found on the internet and splice them together, but to no avail. Here's what I have right now, which is popping up a prompt asking number of rows, and then it proceeds to copy the two selections I want and insert them, just like I want it to for ONE insert. Anyone know how I can get it to insert "X" number of rows (the number entered into the prompt)? Here's my current code: Sub InsertRow() Dim Rng Rng = InputBox("How many additional states?") Range("42:52").Copy Rows("53").Select Selection.EntireRow.Insert Rows("30").Copy Rows("31").Select Selection.EntireRow.Insert Application.CutCopyMode = False End Sub Any help is much appreciated!! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy a worksheet to new one with repeat rows 5 times | Excel Discussion (Misc queries) | |||
Duplicate rows a given number of times in Excel? | Excel Programming | |||
Macro to copy exactly the I number of times that he/she appears in the column | Excel Programming | |||
how do i copy down x number of times | Excel Worksheet Functions | |||
Copy a formula down a set number of times | Excel Worksheet Functions |