+ Reply to Thread
Results 1 to 4 of 4

Find and remove each item from table

  1. #1
    Registered User
    Join Date
    11-05-2010
    Location
    Over, There
    MS-Off Ver
    Excel 2016
    Posts
    44

    Find and remove each item from table

    I have a sheet that has categories for each item, and some items are new so the category is unknown. Column A is where the category is placed and column C is the item. So what I am trying to do is search column A and if there is an cell that has "UNKNOWN" then remove that item. My problem is I cannot seem to remove all of the unknowns for that item.

    Here's my code that I have:
    Please Login or Register  to view this content.
    If I use that code it removes just the first entry. If I add Range("A1").Activate before I delete the rows then it deletes the first 4 items.

    I recorded a macro and the code I got was:

    Please Login or Register  to view this content.
    which is exactly the same thing I get when I put the DeleteRows varible in a messagebox (except for the extra comma at the end). I did a Range(Left(DeleteRows, Len(DeleteRows) - 1)).Select and it selects the correct cells. Then I deleted them myself and it worked just fine. Any reason this is happening?


    I just want to make sure I'm not going crazy.
    Last edited by Demon4231; 02-19-2012 at 04:52 PM.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Can someone please explain this before I go insane

    Maybe something like this?

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-05-2010
    Location
    Over, There
    MS-Off Ver
    Excel 2016
    Posts
    44

    Re: Can someone please explain this before I go insane

    Quote Originally Posted by JieJenn View Post
    Maybe something like this?

    Please Login or Register  to view this content.
    Hmm... very close. All but the first one and the last one were deleted. Maybe I can just do a Find to remove the last two.

  4. #4
    Registered User
    Join Date
    11-05-2010
    Location
    Over, There
    MS-Off Ver
    Excel 2016
    Posts
    44

    Re: Find and remove each item from table

    After getting some sleep I finally got it to work. Here's what I have, which is very simple.

    Please Login or Register  to view this content.

+ 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