+ Reply to Thread
Results 1 to 4 of 4

Hiding Specific Cells thru Checkbox

Hybrid View

  1. #1
    Registered User
    Join Date
    04-22-2014
    Location
    NJ, USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Question Hiding Specific Cells thru Checkbox

    Good afternoon,

    I am relatively new to coding things on Excel (it's been a solid 5 years since I've last coded anything - I have basic knowledge but, in essence, I know nothing).

    I'm looking to see if it's possible for me to leave information in specific cells hidden unless a checkbox is marked off. I do not need/want the entire column or row hidden (which I've found plenty of tutorials on via google)

    I'll try to provide a basic example:

    ie: Column A1: checkbox;;;Column B1: Dairy;;;Column C1: milk;;;Column D1: slim milk
    Column A2: checkbox;;;Column B2: Poultry;;;Column C2: beef;;;Column D2: hamburgers;;;Column E2: bubba burgers (<--not a fan of them)

    (the values in row C and D will never change - there are some instances where there are values in column E)

    I need the checkboxes in column A and the information in column B visible at all times but C and D (and E) visible only if the checkbox is checked.

    Here is an example code I tried creating myself (with the help of the .entirerow.hidden and .entirecolumn.hidden codes I found online). Obviously it didn't work lol, but I was wondering if there is a way to only get these specific cells to hide rather than an entire row/column.

    Sub CheckBox1_Click()
    If CheckBox1_Click = True Then
    Range(C26, C27, D26, D27).Cells.Hidden = False
    Else
    Range(C26, C27, D26, D27).Cells.Hidden = True
    End If
    End Sub

    Thank you for the assistance!
    Jason
    Last edited by JasonKid1; 04-22-2014 at 05:17 PM. Reason: bolded key information for the quick scanners out there

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Hiding Specific Cells thru Checkbox

    You cannot hide any specific cell in excel, either you have to hide the Entire Column Or Row...

    Sub CheckBox1_Click()
    Dim blStatus As Boolean
    
    If CheckBox1_Click Then blStatus = True
    Range("C26,C27,D26,D27").EntireRow.Hidden = blStatus
        
    End Sub


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    04-22-2014
    Location
    NJ, USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Hiding Specific Cells thru Checkbox

    Would there be a make-shift way to hide individual cells? (ie: bring them forward once a checkbox is clicked). Essentially, is there a way to act like these cells are hidden/unhidden until a checkbox is marked off?

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Hiding Specific Cells thru Checkbox

    If you format a cell with three semi-colons (custom formatting option), the contents of the cell is hidden from view.

    Lewis

+ 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. Need VBA for hiding checkbox in excel
    By dhivyamohan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-06-2013, 08:26 AM
  2. Using CASE and hiding a checkbox
    By uncleslinky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2013, 05:57 AM
  3. Finding specific pattern, hiding other cells
    By andy.k in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2013, 12:50 AM
  4. Replies: 0
    Last Post: 10-20-2011, 03:21 PM
  5. Hiding/un-hiding non-specific rows and specific columns
    By MusicMusic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2008, 09:54 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