+ Reply to Thread
Results 1 to 4 of 4

Macro to hide columns if Header Name contains certain Character or Sign or Number

  1. #1
    Registered User
    Join Date
    06-05-2012
    Location
    mumbai
    MS-Off Ver
    Excel 2007
    Posts
    60

    Macro to hide columns if Header Name contains certain Character or Sign or Number

    I have a worksheet with info in columns A2:IF2, For this data I need a macro that will look for the number "20" (for example, I have following headers in the data "TTL-20 SLS_QTY", "TTL-20 SLS_VAL" that needs to be hide) OR "YTD ACH%" in the column header and if it's there to then hide that particular column and move on and check the next. (NOTE: Column headers is in the 2nd row of the sheet)

    I am struggling to find VBA to do this for me. I've been researching and trying different things for hours without success. Can anyone help? Thank you.

    I have attached the file with headers for your reference.

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Macro to hide columns if Header Name contains certain Character or Sign or Number

    Hi sandubandu,

    Try below code ...
    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Registered User
    Join Date
    06-05-2012
    Location
    mumbai
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Macro to hide columns if Header Name contains certain Character or Sign or Number

    Its workng fine ! thanks a lot !

  4. #4
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Macro to hide columns if Header Name contains certain Character or Sign or Number

    Glad to help & thanks for the added Rep.

    If that takes care of your original question, please take a moment & mark the thread as [SOLVED] from the Thread Tools above your first post

+ 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/show columns based on the year in the header of the column
    By lukelucky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-19-2015, 04:03 AM
  2. Hide the MINUS sign in a negative number?
    By potejam in forum Excel General
    Replies: 8
    Last Post: 01-29-2014, 03:16 PM
  3. [SOLVED] VBA to hide columns if header match
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2013, 09:23 AM
  4. [SOLVED] What code can I use to hide columns with the same header?
    By connieb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-27-2013, 08:52 PM
  5. Hide Columns by header
    By sirdon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2013, 01:19 AM
  6. How to hide all empty columns without including the column header
    By mkingsberry in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-09-2010, 12:27 PM
  7. Macro to hide CHR(10) Character
    By JimmiOO in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-12-2010, 04:47 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