+ Reply to Thread
Results 1 to 2 of 2

Toggle hide/unhide columns based on another cell being blank or not

  1. #1
    Registered User
    Join Date
    10-05-2014
    Location
    Nelson New Zealand
    MS-Off Ver
    2007
    Posts
    7

    Toggle hide/unhide columns based on another cell being blank or not

    Hi Everyone,
    Noob here

    I have a worksheet that I am trying to make a portion of it (say columns J to Q) unhide when a particular cell (say A1) has content.
    When the content of cell A1 is deleted or not there to begin with, Columns J to Q should hide.

    My pseudo-code:

    IF A1 is blank Then
    Columns (J:Q).Hidden = True

    Else IF A1 is not blank Then
    Columns (J:Q).Hidden = False


    This Macro needs to be triggered everytime A1 is altered.

    I have been sweeping sites and YT videos trying to figure this out and have tried writing differing codes for hours but can't get anywhere.

    Thanks In advance

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Toggle hide/unhide columns based on another cell being blank or not

    One option is to use Worksheet's Change event. For example, go into the VBA window of the worksheet you want to check the value change, then insert the macro as
    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. Toggle hide/unhide multiple non-adjacent columns
    By toulouse330 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-26-2020, 02:05 PM
  2. Toggle hide/unhide multiple non-adjacent columns
    By toulouse330 in forum Excel General
    Replies: 1
    Last Post: 12-26-2020, 12:55 PM
  3. [SOLVED] Toggle Between Hide and Unhide Columns
    By jmklei0 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2020, 11:36 AM
  4. [SOLVED] Toggle Button to hide/unhide blank rows
    By therealaccountant in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-05-2019, 07:56 PM
  5. [SOLVED] Toggle Button to hide/unhide rows based on value
    By therealaccountant in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2019, 12:40 PM
  6. button to toggle hide/unhide columns
    By dbuff in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2013, 07:56 PM
  7. Hide/Unhide Multiple Sets of Columns with Toggle Button
    By Mischief433 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-06-2012, 05:55 AM

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