Closed Thread
Results 1 to 3 of 3

adding rows to excel table

  1. #1
    haystack
    Guest

    adding rows to excel table

    I have created an inventory table with about 500 rows (one per item). Now, I
    need to add five blank rows after each already entered row. These 5 new rows
    contain a formula that is constant throughout the whole thing. Is there a
    way to do this without manually adding them one by one? can't i just create
    one set of the new rows including the formula and tell the program to insert
    it after each existing row?

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    haystack

    here is a macro that will insert 5 blank lines after every row

    something similar can be done to insert formulas as required or to copy a range and paste it into the blank rows

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    haystack

    Looks like I had a hiccup with my previous post as the code did not show up

    here is a macro that will insert 5 blank lines after every row

    something similar can be done to insert formulas as required or to copy a range and paste it into the blank rows


    Sub InsertRows()
    Dim lRow As Long
    For lRow = Cells(Rows.Count, "a").End(xlUp).Row To 2 Step -1
    Rows(lRow & ":" & lRow + 4).Insert Shift:=xlDown
    Next lRow
    End Sub

Closed Thread

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