+ Reply to Thread
Results 1 to 4 of 4

VBA to delete rows from multiple criteria using text from cells

  1. #1
    Registered User
    Join Date
    07-27-2020
    Location
    Pennsylvania
    MS-Off Ver
    2016
    Posts
    13

    VBA to delete rows from multiple criteria using text from cells

    I am creating a registration process for programs and trips. I am creating a macro to delete all rows based upon 2 criteria "Resident Name" and "Program Name. This would be used should someone choose to cancel their registration.

    This is what I have so far. I am stuck on the text string part of the formula. The text string will change anytime someone wants to cancel. Therefore, I can not hardcode the values.

    My table is in Range A1:D1000. The text value of "Resident Name" is in cell H1 and "Program Name is in G1. I would need the macro to delete all rows from A1:D1000 if it matches the criteria in cells H1 and G1.

    I know something special has to be done because H1 and G1 is text rather than a value.

    Any help would be appreciated.



    Please Login or Register  to view this content.
    Last edited by jrod59; 10-19-2020 at 02:02 PM.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VBA to delete rows from multiple criteria using text from cells

    Cells is rows, columns so you are looking in row 8 & 9 for column A, so you need to swap them round.

  3. #3
    Registered User
    Join Date
    07-27-2020
    Location
    Pennsylvania
    MS-Off Ver
    2016
    Posts
    13

    Re: VBA to delete rows from multiple criteria using text from cells

    Thank you. And here I thought this was some impossible task.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VBA to delete rows from multiple criteria using text from cells

    You're welcome & thanks for the feedback.

+ 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. Delete all rows which doesn't contain certain text criteria (various criteria)
    By ellbeardo in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-14-2020, 10:36 AM
  2. [SOLVED] Delete Rows with Multiple Criteria
    By MusicMan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2018, 02:49 PM
  3. Delete Rows Based On A Text Criteria
    By NSTurk725 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-24-2014, 12:22 AM
  4. Delete Rows using multiple criteria
    By markhao in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-07-2011, 10:18 PM
  5. Delete rows based on multiple criteria (Date & Text)
    By Poulan in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 10-08-2010, 09:00 AM
  6. delete rows with multiple criteria
    By myparticulars in forum Excel General
    Replies: 2
    Last Post: 09-08-2009, 06:25 PM
  7. Delete rows where cells contain various criteria
    By gmunro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2005, 11:06 AM

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