+ Reply to Thread
Results 1 to 4 of 4

VBA Macro - Insert Rows based on different Column Value but Ignoring Blanks Cells

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    RC
    MS-Off Ver
    Excel 2007
    Posts
    10

    VBA Macro - Insert Rows based on different Column Value but Ignoring Blanks Cells

    Hi,

    I'm trying to correct my macro that would insert rows based on a value declared in a column.

    Attached is a small sample of my worsksheet with the "before" and what the "after" should be.
    So far the code I have:

    Please Login or Register  to view this content.
    Basically trying to insert rows to separate the different dates of each invoice in the sheet.

    Since the string "INVOICE #" in Column A seems to be the only constant value, I declared that as the new value which the old value has to match, however if there's a better way feel free to point it out to me.

    Problem when I run my code is that the macros stop inserting rows once it comes up with a blank cell in Column A, so rather than inserting a new row on every single unique order, it just stops at the 1st order.

    Any help would be great, thank you.
    Attached Files Attached Files
    Last edited by WITJ; 04-12-2013 at 02:42 PM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Macro - Insert Rows based on different Column Value but Ignoring Blanks Cells

    The attached is not working, assuming the invoice #s are in column A

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-11-2013
    Location
    RC
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA Macro - Insert Rows based on different Column Value but Ignoring Blanks Cells

    Quote Originally Posted by AB33 View Post
    The attached is not working, assuming the invoice #s are in column A

    Please Login or Register  to view this content.
    Hi and thank you AB33!

    Sorry you couldn't open the attachment.

    Your code worked near perfect! I just did a simple modification to the:

    Please Login or Register  to view this content.
    Since the unique Dates were actually on the row bove the "INVOICE #" which you wouldn't have seen since you couldn't open the attachment.

    But thank you, it worked!

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Macro - Insert Rows based on different Column Value but Ignoring Blanks Cells

    WITJ,
    You are welcome!

+ 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