+ Reply to Thread
Results 1 to 4 of 4

VBA Code To Filter Data Based On First 2 Letters Of Word From Multiple Columns

  1. #1
    Registered User
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    VBA Code To Filter Data Based On First 2 Letters Of Word From Multiple Columns

    Hi,

    I am looking for a way to filter data based on the acronyms of two columns (SI_STRATIGRAPHY and SI_STRAND) from an excel spreadsheet. I need to be able to highlight data where the first two letters of SI_STRATIGRAPHY do not match the first two letters of SI_STRAND. Highlighted examples are shown in the screenshot attached.

    Any help is much appreciated.

    Kind Regards
    Attached Images Attached Images

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: VBA Code To Filter Data Based On First 2 Letters Of Word From Multiple Columns

    Use conditional format to do this,
    Since I do not have the data and am not going to type things I think you can manage.
    Just select the entire range and add a new Conditional format rule using a formula that tests what you need and for true apply the desired format
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    Re: VBA Code To Filter Data Based On First 2 Letters Of Word From Multiple Columns

    Hi Keebellah, thanks for your response, still seem to be struggling with this. Any chance you could give an example of the formula that should be used with conditional formatting? There are two columns to compare data with about 20,000 rows of data.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: VBA Code To Filter Data Based On First 2 Letters Of Word From Multiple Columns

    Very simple.
    For starters select the range A2 through K26

    Then go to Conditional Format and new rule based on formula
    The formula:
    Please Login or Register  to view this content.
    set the format and after pressing OK

    Apply to ...
    Please Login or Register  to view this content.
    Notice that the formula only has a $ at the column NOT the row

    Hope this helps

+ 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. Filter multiple columns for a single word
    By oceanorigami in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 08:27 PM
  2. Filter multiple columns based on multiple data validation fields
    By Jhunnieboy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2014, 03:41 PM
  3. Macro to filter data and copy the data's from multiple columns based on the criteria
    By millatshawn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-22-2014, 08:14 AM
  4. Filter data from a Master sheet based on multiple criteria by VBA code
    By judeprem in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2013, 03:27 PM
  5. Replies: 2
    Last Post: 03-26-2012, 11:16 AM
  6. Filter based on values of multiple columns
    By learning in forum Excel General
    Replies: 8
    Last Post: 09-29-2009, 03:17 AM
  7. [SOLVED] Filter data based on multiple columns
    By [email protected] in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 04-28-2006, 11:50 AM
  8. Filter based value in multiple columns
    By Melissa in forum Excel General
    Replies: 1
    Last Post: 10-05-2005, 05: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