+ Reply to Thread
Results 1 to 3 of 3

If a search term can be found 1 time, 2 times 3 times 4 times 5 times

  1. #1
    Forum Contributor
    Join Date
    09-17-2013
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    115

    If a search term can be found 1 time, 2 times 3 times 4 times 5 times

    If a search term can be found 1 time then delete cells A1-A4,if found 2 times delete cells then delete cells A2-A4
    ,if found 3 times delete cells then delete cells A3-A4,,if found 4 times delete cells then delete cell A4-A4.
    Term is given in cell "B1"

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: If a search term can be found 1 time, 2 times 3 times 4 times 5 times

    I have no idea how to do this with VBA, but another option might be to use a formula in those cells that counts the term and then based on that, either shows the value in the cell, or hides it (this will only work if those cells contain a formula in the 1st place)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: If a search term can be found 1 time, 2 times 3 times 4 times 5 times

    See attached workbook which shows how to solve your problem using 'COUNTIF' which is case INSENSITIVE. The workbook also includes function 'CountifCaseSensitive' which can be substituted.

    As an added bonus, you can 'Double Click' on an item, which is the same as having the value in cell 'B1'.

    Worksheet Module:
    Please Login or Register  to view this content.
    Normal Code Module:
    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)

Similar Threads

  1. [SOLVED] Creating a graph with start times and end times vs time
    By khoadphamm in forum Excel General
    Replies: 14
    Last Post: 12-31-2019, 02:57 PM
  2. [SOLVED] calculate turn around times range of times for weekday and weekend
    By xrayexceller in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-28-2013, 02:22 PM
  3. Macro Loop – Find Specific Times, Extract Date, Average Values of Times
    By ExcelQuestFL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-25-2010, 02:50 PM
  4. Macro to help sort date - times and average similar times.
    By ferretydeath in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2008, 05:44 PM
  5. capture:How are relay leg times or driving times entered and totaled?
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 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