+ Reply to Thread
Results 1 to 8 of 8

Unhide columns based on a cell value

  1. #1
    Forum Contributor
    Join Date
    02-13-2016
    Location
    MUMBAI
    MS-Off Ver
    Microsoft 365
    Posts
    180

    Unhide columns based on a cell value

    Hii everyone,

    Needed a macro for the following:

    If cell K4>0 in sheet 1, unhide columns L to AL in sheet1
    If cell J4>0 in sheet 2, unhide columns L to AL in sheet2

    thank you.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Unhide columns based on a cell value

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: Unhide columns based on a cell value

    Here you go:

    Please Login or Register  to view this content.
    Regards,
    Thangavel D

    Appreciate the help? CLICK *

  4. #4
    Forum Contributor
    Join Date
    02-13-2016
    Location
    MUMBAI
    MS-Off Ver
    Microsoft 365
    Posts
    180

    Re: Unhide columns based on a cell value

    Done..Thanks..!!

  5. #5
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: Unhide columns based on a cell value

    You welcome

  6. #6
    Forum Contributor
    Join Date
    02-13-2016
    Location
    MUMBAI
    MS-Off Ver
    Microsoft 365
    Posts
    180

    Re: Unhide columns based on a cell value

    Continuing the above, the macro does not run if the sheets are protected..

    so is there a way to first unprotect the sheet, run the macro & then again protect the sheet all through a macro.

    what modifications I have to do to the above code to give such effect?

    the password for both the sheet is say "abcd"..

    thanks..

  7. #7
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: Unhide columns based on a cell value

    Hi Vivek,

    In ThisWorkbook Editor
    Paste Below code

    Please Login or Register  to view this content.
    Regards,
    MohanS


    "Perfection is not attainable, but if we chase perfection we can catch excellence." - Vince Lombardi

    You can simply say thanks by clicking "*Add Reputation" icon

  8. #8
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Unhide columns based on a cell value

    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] Hide/Unhide columns based on the value of the cell help!
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-11-2014, 09:03 PM
  2. [SOLVED] Hide/Unhide Columns based on Cell Value
    By dberg in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-26-2013, 03:36 PM
  3. Unhide columns based on value in row 3 matching cell A3
    By ahumphreys02 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2013, 04:53 PM
  4. VBA. unhide columns based on value in one specific cell.
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-19-2012, 07:26 PM
  5. Hide/Unhide columns based on value of a cell
    By redrackham in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-24-2011, 09:14 AM
  6. Hide & Unhide columns based on a cell value
    By DaveNUFC in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-21-2010, 09:40 AM
  7. Hide or Unhide certain columns based on a cell value
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2006, 01:04 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