+ Reply to Thread
Results 1 to 8 of 8

auto clear row and move data up when quantity=0

  1. #1
    Registered User
    Join Date
    11-11-2010
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    16

    auto clear row and move data up when quantity=0

    I would like wh1 wh2 wh3 wh4 to clear the line and move the data up when an item quantity is 0. I would like this to happen automaticly. how can i do this?
    Attached Files Attached Files

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: auto clear row and move data up when quantity=0

    Try pasting this into the ThisWorkbook tab in the VBA editor.

    Please Login or Register  to view this content.
    Martin

  3. #3
    Registered User
    Join Date
    11-11-2010
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: auto clear row and move data up when quantity=0

    thanks that is what i wanted!!!! have a great day!!!!

  4. #4
    Registered User
    Join Date
    11-11-2010
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: auto clear row and move data up when quantity=0

    mrice, I need this to only run on certin sheets not the entire file. how can i do this?

  5. #5
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: auto clear row and move data up when quantity=0

    The line

    Please Login or Register  to view this content.
    is used to make sure that the code only runs when the sheet name begins with 'wh'. I understood that this is what you wanted.

  6. #6
    Registered User
    Join Date
    11-11-2010
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: auto clear row and move data up when quantity=0

    when i put the code in and try to run my total button on my total page i receive a run time 13 type mismatch. when i hit debug it pull up the code and highlights If Target.Row >= 3 And Target.Column = 2 And Target.Value = 0 Then

    thanks for all the help
    Attached Files Attached Files

  7. #7
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: auto clear row and move data up when quantity=0

    OK - need to modify slightly as your macro was changing several cells at the same time and as such Target didn't have a single defined value - hence the error.

    In the following...

    Please Login or Register  to view this content.
    ... I have added an extra line so that the code only runs if a single cell is changed.

  8. #8
    Registered User
    Join Date
    11-11-2010
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: auto clear row and move data up when quantity=0

    Thanks! Works like a champ!!!

+ 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