+ Reply to Thread
Results 1 to 10 of 10

Remove Row If Found Specific Value

  1. #1
    Registered User
    Join Date
    10-31-2022
    Location
    Kuala Lumpur
    MS-Off Ver
    2021
    Posts
    11

    Question Remove Row If Found Specific Value

    Hi all,

    I am currently creating a VBA macro that can help to read "specific value".

    If found the "specific value", delete the whole row,
    If not found "specific value", keep the whole row.

    For example, you may see the files that I have attached. The main file is "All User Details" and subfiles ("User ID") are "13842", "43686" and "26698".

    I want a macro that can read the "User ID" and find "specific values" like "pikol, hbkis, tgsdf" in "13842", "43686" and "26698".

    Condition 1: If the "specific values" exists in the subfiles, delete the whole row from "All User Details".
    Condition 2: If the "specific values" does not exist in the subfiles, remain the whole row from "All User Details".

    There is an attached result file "All User Details (Result)", please have a look about it.

    Do not hesitate to let me know if you have any enquiry.

    Appreciate anyone who can help me in assisting to create this macro. Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,569

    Re: Remove Row If Found Specific Value

    This assumes all the files incl. All User Detail in the same folder.
    If not you need to adjust myDir,
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-31-2022
    Location
    Kuala Lumpur
    MS-Off Ver
    2021
    Posts
    11

    Re: Remove Row If Found Specific Value

    It works well, thank you very much and have a nice day!

  4. #4
    Registered User
    Join Date
    10-31-2022
    Location
    Kuala Lumpur
    MS-Off Ver
    2021
    Posts
    11

    Re: Remove Row If Found Specific Value

    Hi, I found that I have this message when running this macro.

    This message pop out for many many times.


    How do I solve this? Thank you.


    Attachment 802999

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,569

    Re: Remove Row If Found Specific Value

    Your attachement is invalid so can not open.

  6. #6
    Registered User
    Join Date
    10-31-2022
    Location
    Kuala Lumpur
    MS-Off Ver
    2021
    Posts
    11
    Quote Originally Posted by jindon View Post
    Your attachement is invalid so can not open.
    It shows "Microsoft excel is waiting for another application to complete an OLE action".

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,569

    Re: Remove Row If Found Specific Value

    That's nothing to do with the code.

    If the workgook is not in your local drive, move it to local drive and see how it goes.

  8. #8
    Registered User
    Join Date
    10-31-2022
    Location
    Kuala Lumpur
    MS-Off Ver
    2021
    Posts
    11

    Re: Remove Row If Found Specific Value

    I see.

    Since I am converting pdf to Excel subfiles ("User ID") and then read the Excel file. Is it possible to read the pdf instead of Excel file to do the same thing.?
    How should the code be changed?

    Thank you.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,569

    Re: Remove Row If Found Specific Value

    You are now asking completely different question.

    Open a new thread and explain EXACT situation that you are now.

  10. #10
    Registered User
    Join Date
    10-31-2022
    Location
    Kuala Lumpur
    MS-Off Ver
    2021
    Posts
    11

    Re: Remove Row If Found Specific Value

    Hi jindon,

    I have posted a new thread in my profile. I can't post the link here. Please check it out in my profile.

    Appreciate if there is any macro that can help with. Thank you very much.

+ 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. Search for specific Words within a sentence and return the specific word if found
    By chrishouse55 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-04-2022, 02:58 PM
  2. Looking for a code that will return specific result if specific text is found
    By SpreadSheetMom in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2020, 04:32 PM
  3. Replies: 6
    Last Post: 10-19-2018, 02:44 PM
  4. [SOLVED] Remove duplicates but remove first value found not second
    By Carlx12 in forum Excel General
    Replies: 3
    Last Post: 07-11-2018, 05:39 AM
  5. Replies: 1
    Last Post: 12-11-2013, 09:09 PM
  6. excel macro to remove specific columns and rows + remove duplicate
    By garrywelson in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-17-2013, 12:03 PM
  7. fastest way to find the row where a specific text is found in a specific column
    By getgray in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2011, 02:45 PM

Tags for this Thread

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