Results 1 to 8 of 8

Macro to search a range with multiple combined values

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-06-2017
    Location
    Phoenix, AZ
    MS-Off Ver
    2013
    Posts
    129

    Macro to search a range with multiple combined values

    Hi All,

    I’m back again looking for help in how to set up the following formula code.
    I need to count the number of times in col K (K5:K105) any of the following is entered:
    "AV", "BT", "RLCCC", "RLCMO", "RLFW", "RLHCC", "RLHMO", "RPCCC", "RPCMO", "RPHCC", "RPHMO", "TA" And matches one of 8 values listed in col AD rows 5 thru 12. I am thinking that part of the code would use a case or array but am not sure on how to set it up. I have the entire code listed if someone can figure out why my code is giving unstable count results.

    I had this code listed below but it does not give accurate count seems to give counts from 3 to 6 for one actual entry.
    'If value of col K equals "AV", "BT", "RLCCC", "RLCMO", "RLFW", "RLHCC", "RLHMO", "RPCCC", "RPCMO", "RPHCC", "RPHMO", "TA" and
            'L in same row equals AD5 then AE5 is increased by 1
            If Range("L" & Srn) = Range("AD5") Then
                Select Case Target.Value
                    Case "AV", "BT", "RLCCC", "RLCMO", "RLFW", "RLHCC", "RLHMO", "RPCCC", "RPCMO", "RPHCC", "RPHMO", "TA"
                        Range("AE5") = Range("AE5") + 1
                End Select
            End If
    I have attached the full workbook if anyone can find out why my code is giving inaccurate results. Thank you for all help in advance.
    :confused:

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to compare Sheet2 values with Sheet1 cells range (combined with Name Manager)
    By Manish_Gupta in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2014, 08:26 AM
  2. Combined IF ISNUMBER SEARCH for multiple words
    By caffegelato in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-16-2013, 08:57 AM
  3. [SOLVED] Directional Row Search Macro for Multiple Values
    By swilkinson1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2012, 11:20 AM
  4. Macro to return multiple values from search value
    By Mr Low in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-11-2012, 02:00 PM
  5. Search for multiple range values in another range
    By kuleox85 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-10-2012, 10:23 PM
  6. Search named range for multiple matches to critera and return date & values
    By a.mack123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2011, 10:07 AM
  7. Macro to search multiple values and delete rows.
    By BigSlick in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-05-2008, 04:38 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