+ Reply to Thread
Results 1 to 4 of 4

Hide Columns Based on a Cell Value that DO NOT contain one of multiple values or wildcard.

  1. #1
    Registered User
    Join Date
    01-09-2014
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Hide Columns Based on a Cell Value that DO NOT contain one of multiple values or wildcard.

    Hello,

    I’m a macro/VBA rookie and I’m trying to build a macro that hides or shows columns that don’t contain multiple values or partial text strings. I’ve found and modified code that will hide or show all columns that don’t contain one value, but I’m having trouble with using a wildcard or multiple criteria.
    Here’s the code I’m trying to use. The “Or” command seems to be the problem.



    Code:
    Please Login or Register  to view this content.
    I also tried using a wildcard but these did not work:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    In plain ‘ole English, I need the macro to hide all columns based on a cell value that don’t contain LABEL1, LABEL2, etc. (C-PRG and S-PRG in my code above.) I’d also need a macro that hides all columns based on a cell value that don’t contain a wildcard search, such as all columns whose cell reference does not contain *BEL* (I’m using BEL as an example since it is contain in the word LABEL.)
    Can anyone help?

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Hide Columns Based on a Cell Value that DO NOT contain one of multiple values or wildc

    Maybe:
    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    01-09-2014
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Hide Columns Based on a Cell Value that DO NOT contain one of multiple values or wildc

    Thanks for the reply! I pasted this line in to replace mine but it still appears to hide all the columns, even the ones that contain PRG. Any advice?

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Hide Columns Based on a Cell Value that DO NOT contain one of multiple values or wildc

    Try:

    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. Hide columns based on cell value (multiple options)
    By fishsticks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-08-2013, 05:36 AM
  2. [SOLVED] Checkbox VBA - Hide/Unhide Rows and/or Columns based on cell values
    By gravy258 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-21-2013, 05:39 PM
  3. How to hide a row based on multiple cell values
    By csh8428 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-08-2012, 10:02 AM
  4. Macro to hide columns based on cell values in the column to be hidden
    By JCMus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2012, 06:06 PM
  5. Hide columns in multiple worksheets based on one cell.
    By -Johan- in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2011, 02:36 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