View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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/