Results 1 to 2 of 2

Help with inserting mulitple rows in worksheet

Threaded View

  1. #1
    Registered User
    Join Date
    07-11-2013
    Location
    Dracut, MA
    MS-Off Ver
    Excel 2013
    Posts
    2

    Help with inserting mulitple rows in worksheet

    I am using this formula but it won't stop I want to do a range of A2:A300 inserting 12 rows in between them. the sheet already has employee names so i want 12 blank rows after name.

    It works but I can't stop the loop!!!!


    Sub test()    
    Dim j As Long, r As Range    
    j = InputBox("type the number of rows to be insered")    
    Set r = Range("A2")    
    Do    
    Range(r.Offset(1, 0), r.Offset(j, 0)).EntireRow.Insert    
    Set r = Cells(r.Row + j + 1, 1)    
    MsgBox r.Address    
    If r.Offset(1, 0) = "" Then Exit Do    
    Loop    
    
    End Sub
    Thanks,

    Nadia
    Last edited by Nadia June; 07-12-2013 at 12:10 PM. Reason: I didn't follow code 3 rule, sorry

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1