Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Automatically Insert New Rows
I have a spreadsheet where I need to copy a row and have EXCEL automatically copy new rows based on a number inputted by the user (less 1).
I've used a code which was previously posted that creates a box asking how many rows I need. This works fine but the problem is that people often input one row too many For example: If they need 10 rows overall , they inadvertently input a 10 ... giving a total of 11 rows (the original row + the 10 NEW rows) ) So I was wondering if anyone would know how to fine tune the code so that it would give me one less row than what the user inputs. Here's the code that I use: Sub copyrows() numrows = InputBox("Number of rows") 'Rows(ActiveCell.Row).Copy ActiveCell.Resize(numrows) Rows(ActiveCell.Row).Copy ActiveCell.Resize(numrows).Insert Application.CutCopyMode = False End Sub Thanks for any Help |
#2
|
|||
|
|||
Conditional format formula is =MOD(ROW(),2)=0 select row format and apply to all rows. This will leave odd rows uncoloured. If even rows to be coloured make formula =1 instead.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert a rows automatically | Excel Worksheet Functions | |||
How do I automatically insert rows | Excel Discussion (Misc queries) | |||
automatically insert new rows in a list | Setting up and Configuration of Excel | |||
Automatically insert rows with formula | Excel Worksheet Functions | |||
Automatically Insert New Rows | Excel Discussion (Misc queries) |