If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Insert Multiple Rows

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-11-08, 20:33
freshabundance freshabundance is offline
Registered User
 
Join Date: Nov 2005
Posts: 18
Insert Multiple Rows

The following code works great to insert 2 rows in a spreadsheet

Code:
Sub RowInsert()

For x = 2 To 12000
Rows(x & ":" & x + 1).Select
Selection.Insert Shift:=xlDown
x = x + 2
Next x

End Sub
How can I change it to insert 49 rows?
Reply With Quote
  #2 (permalink)  
Old 06-12-08, 05:59
chergh chergh is offline
Registered User
 
Join Date: Apr 2008
Posts: 6
Code:
Sub RowInsert()

For x = 2 To 12000
Rows(x & ":" & x + 48).Select
Selection.Insert Shift:=xlDown
x = x + 49
Next x

End Sub
Reply With Quote
  #3 (permalink)  
Old 06-12-08, 16:01
freshabundance freshabundance is offline
Registered User
 
Join Date: Nov 2005
Posts: 18
Works great! Thanks!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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