Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub tst()
x = InputBox("How many rows ") ActiveCell.Resize(x, 1).EntireRow.Insert End Sub "Steve" skrev: Hello. Below is my code that inserts a row in multiple sheets based on where the active cell is. This inserts one row at a time. The users often need to insert many rows. How can I prompt the user to ask how many rows they would like to insert, and then have vba use that input and insert that many rows? Thanks!! Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", )).Select Sheets("Sheet1").Activate ActiveCell.Offset(1, 0).EntireRow.Select Selection.Insert Shift:=xlDown ActiveCell.Offset(-2, 0).Select ActiveCell.EntireRow.Copy ActiveCell.Offset(1, 0).EntireRow.Select Selection.PasteSpecial Paste:=xlFormulas, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False Selection.End(xlToLeft).Select |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do insert multiple rows in between multiple lines | Excel Discussion (Misc queries) | |||
Insert Variable Number of Rows; With Loop | Excel Worksheet Functions | |||
Need to insert formula to a variable number of rows | Excel Programming | |||
insert variable number of rows | Excel Programming | |||
Insert rows in depending on criteria in variable columns | Excel Programming |