+ Reply to Thread
Results 1 to 8 of 8

Delete row if item is not equal to sku

  1. #1
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Delete row if item is not equal to sku

    Hi,

    I have a list of Items equal to a sku id shown below:

    Item = Sku
    RPC0094 = 17343D
    RPC0097 = 17263D
    RPC0068 = 17232B

    For my project VBA is required so I have been trying to remove the rows where the Item is not equal to sku in the list above.

    In the attached excel file I have displayed what is needed in the AfterVBA sheet.

    Any help is appreciated.

    Thanks,

    David
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Delete row if item is not equal to sku

    How about

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Delete row if item is not equal to sku

    Thanks JEC, it works good my list may have over 100 items so I will try create new lines.

  4. #4
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Delete row if item is not equal to sku

    In that case, it is better to have a list of items and their Sku stored in a tab.
    Refer to that list in VBA instead of hard coding them all.

  5. #5
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Delete row if item is not equal to sku

    Thanks JEC for your help and advice, unfortunately it must be hard coded as the VBA will be applied to an excel document that has been exported from a database.

    Again I appreciate your help,

    David

  6. #6
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Delete row if item is not equal to sku

    Here an example. There should be a way to refer to a list. Maybe from a different workbook.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Delete row if item is not equal to sku

    Your code gave me an idea and the below works perfect, thanks JEC for all your help.

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Delete row if item is not equal to sku

    You're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Adding delete code on userform to delete a row on sheet by selecting item on a listbox
    By darbar76528 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-07-2020, 12:50 PM
  2. Most Occuring Item based off other cell equal cirteria
    By keiserj in forum Excel General
    Replies: 12
    Last Post: 07-01-2014, 09:14 AM
  3. Delete Row if equal to Cell
    By Dnass in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2013, 01:13 AM
  4. Delete row if some columns equal others. HELP
    By lmvmbc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-24-2013, 01:42 PM
  5. Delete row if some columns equal others
    By lmvmbc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2013, 11:14 PM
  6. Replies: 0
    Last Post: 03-10-2006, 12:23 PM

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