+ Reply to Thread
Results 1 to 5 of 5

Macro to insert blank rows below rows with values

  1. #1
    Registered User
    Join Date
    07-28-2012
    Location
    Morgantown, WV
    MS-Off Ver
    Excel 2007
    Posts
    54

    Unhappy Macro to insert blank rows below rows with values

    All,

    I am requesting if anyone can help me in creating a macro that will insert blank rows beneath rows containing values in cells. I am a novice learner in creating macros and I appreciate your assistance in this matter. Please view Excel file on attachment name Analysis to view data and step by step instructions in visual form and text boxes. The original list of data is located on the Main worksheet while the step by step instructions on what I am trying to achieve is located on Step 1, Step 2, and Step 3 worksheets. Below is a macro I attempted to create but it only enters rows beneath the value Assets in Column B. I appreciate all the help you all can provide. If you need any questions please send me a reply. Thank you.

    Sub InsertRows()
    Dim i As Long
    i = 2
    Do Until Trim(Cells(i, 2)) = ""
    If Cells(i, 2) = "Asset" Then
    Cells(i, 2).EntireRow.Insert
    i = i + 2
    Else
    i = i + 1
    End If
    Loop
    End Sub
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-30-2013
    Location
    Wales
    MS-Off Ver
    Excel 2013
    Posts
    231

    Re: Macro to insert blank rows below rows with values

    How about

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-28-2012
    Location
    Morgantown, WV
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Macro to insert blank rows below rows with values

    Chris 53,

    For the most part this macro worked! It is amazing. I definitely have to get better in VB skills. The only function that did not work was entering a page break below the rows with the value "Bank" in Column B, I believe this is called a horizontal pagebreak. View Step 3 in the Analysis Excel file on attachment. I will see what I can do to insert this page break.

    Once again thank you so much for your assistance on this, I will wait for your reply.

    Haleakala17

  4. #4
    Forum Contributor
    Join Date
    01-30-2013
    Location
    Wales
    MS-Off Ver
    Excel 2013
    Posts
    231

    Re: Macro to insert blank rows below rows with values

    Sorry did not pick up that you wanted a page break on every instance of B = Bank.

    Please Login or Register  to view this content.
    Probably don't need the pagebreaks after 'LastRow:' either
    Chris
    Last edited by Chris 53; 04-10-2013 at 11:38 AM. Reason: Posted toooo soon.

  5. #5
    Registered User
    Join Date
    07-28-2012
    Location
    Morgantown, WV
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Macro to insert blank rows below rows with values

    Chris 53,

    this completely works now. Thank you very much once again.

+ Reply to 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