Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try
Sub AAA() Dim N As Long Dim L As Long Dim R As Long Dim M As Long L = Selection.Rows.Count R = Selection.Cells(1, 1).Row N = Application.InputBox(prompt:="Number of rows to insert", Type:=1) If N <= 0 Then Exit Sub End If For M = 1 To L Cells(R + 1, 1).Resize(N).EntireRow.Insert R = R + N + 1 Next M End Sub Cordially, Chip Pearson Microsoft Most Valuable Professional, Excel, 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com On Thu, 25 Feb 2010 14:47:30 -0800 (PST), JohnHero wrote: I'd like to be able to have a macro that wouod work like this: 1) I highlight the rows 2) When I run the macro, it will ask me how many rows I'd like to insert. 3) It would then insert x number of rows after each highlighted cell. Anybody able to help with this one? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is this impossible? | Excel Discussion (Misc queries) | |||
Impossible | Excel Discussion (Misc queries) | |||
Am I trying the impossible? | Excel Discussion (Misc queries) | |||
is this impossible | Excel Programming | |||
Impossible??? or you can???? | Excel Programming |