Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ali ali is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
to allocate unique a number to existing rows & new insert of row EBC001 Excel Discussion (Misc queries) 0 August 24th 07 11:38 AM
Insert Variable Number of Rows; With Loop ryguy7272 Excel Worksheet Functions 2 December 27th 06 08:25 PM
Insert a specified number of rows dynamically ttbbgg Excel Worksheet Functions 2 March 20th 06 08:27 PM
Insert a number of rows based on a value in a cell on active row iRocco Excel Discussion (Misc queries) 1 August 11th 05 06:18 AM
Insert a number of rows based on a value in a cell on active row iRocco Excel Worksheet Functions 0 August 10th 05 08:46 PM


All times are GMT +1. The time now is 02:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"