Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
insert 'x' number of rows???
Does anyone know a macro that when run will open a box that will reques
the user to enter the number of rows they wish to insert and then, o clicking ok, the desired number of rows is entered either above o below the active cell? I think i spend half my day entering rows so any help will be muc appreciated!! -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
insert 'x' number of rows???
sub Addrows()
num = InputBox("Enter number of rows to insert above active cell") if num < "" then if isnumeric(num) then activeCell.Resize(num).Entirerow.Insert end if end if End sub You could indicate below the activecell by entering a negative number sub Addrows() num = InputBox("Enter number of rows to insert ") if num < "" then if isnumeric(num) then if clng(num) < 0 then activecell.Offset(1,0).Resize(abs(num)).Entirerow. Insert else activeCell.Resize(num).Entirerow.Insert End if end if end if End sub -- Regards, Tom Ogilvy "ali" wrote in message ... Does anyone know a macro that when run will open a box that will request the user to enter the number of rows they wish to insert and then, ok clicking ok, the desired number of rows is entered either above or below the active cell? I think i spend half my day entering rows so any help will be much appreciated!!! --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
to allocate unique a number to existing rows & new insert of row | Excel Discussion (Misc queries) | |||
Insert Variable Number of Rows; With Loop | Excel Worksheet Functions | |||
Insert a specified number of rows dynamically | Excel Worksheet Functions | |||
Insert a number of rows based on a value in a cell on active row | Excel Discussion (Misc queries) | |||
Insert a number of rows based on a value in a cell on active row | Excel Worksheet Functions |