LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Modify ADD ROWS Code - Excel 2003

Hello,

I found this code when researching to add rows to a worksheet. Could
someone help me modify it so that when I'm running the code to add rows
to multiple worksheets in a workbook that does not have but 3 rows
bucause this code will not work if the worksheet does not have at least
4 rows of text?

I have 75 worksheets in my workbook but some of the worksheets have
only 3 rows of text and the below code will stop working. How can the
code be changed so that if there is no text in the 4 row the code will
know to move to the next worksheet in the workbook?

Sub Add_rows()
'will put 3 row between rows
Irow = Range("A65536").End(xlUp).Row
Application.ScreenUpdating = False
Do Until Irow = 4
Set Rng = Range("A" & Irow)
Rng.Resize(3, 1).EntireRow.Insert
Irow = Irow - 1
Loop
Application.ScreenUpdating = True
End Sub

Thank you for your help in advance,
jfcby

 
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
Modify Excel (2003) code for Network environment JMay Setting up and Configuration of Excel 1 March 9th 09 01:05 PM
Modify Macro Code Depending on Excel Version John Taylor Excel Discussion (Misc queries) 11 February 26th 07 04:19 AM
User not being prompted to enter Password to modify Excel 2003 kmorl Excel Discussion (Misc queries) 2 October 20th 06 05:32 PM
modify xlsx files with excel 2003 mallorypr Excel Discussion (Misc queries) 0 July 10th 06 03:15 PM
How can I surpass/modify the Excel limit of 65k rows? Jacob Excel Discussion (Misc queries) 1 November 22nd 05 08:42 PM


All times are GMT +1. The time now is 01:33 AM.

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"