+ Reply to Thread
Results 1 to 4 of 4

Hiding / Revealing Form Controls 'CheckBoxes' based on Cell Values

  1. #1
    Registered User
    Join Date
    04-26-2013
    Location
    Seattle, Washington
    MS-Off Ver
    Excel 2007
    Posts
    3

    Talking Hiding / Revealing Form Controls 'CheckBoxes' based on Cell Values

    Hello everyone,

    I've been trying to solve this issue for the past two weeks, and cannot seem to get it worked out. I have uploaded my workbook (redacted)
    to help illustrate what I'm trying to accomplish. On sheet 1, titled "Hospital Contacts", I have a drop down list for the user to select a facility. When the facility is selected, other cells are populated with contact information for personnel associated with the facility. At last count, the personnel field was up to 55 people (located at one facility).
    I'm attempting to place a Check Box next a person's name so that the user may select the individual they wish, ultimately to cut/paste the contact information into a chart note, etc...
    Here are the ranges for what I'm trying to accomplish:
    Personnel, the cells I want to search are the range E12:E55.

    The closest I've come to accomplishing this has been:

    Private Sub Worksheet_Calculate()

    Dim ChkBox As Object
    With ActiveSheet
    For Each ChkBox In .CheckBoxes
    If .Range("E12:E55") = " " Then
    ChkBox.Visible = False
    Else:
    ChkBox.Visible = True
    End If
    Next ChkBox
    End With

    End Sub

    Obviously, this doesn't work. I usually get a Type_mismatch error r/t the 'If' statement ".Range("E12:E55").
    I've researched my behind off and just can't seem to get it. So, I'm throwing in the towel and asking for any help. Thank you in advance for even just a suggestion as to how to approach this

    Sample.xlsm

  2. #2
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: Hiding / Revealing Form Controls 'CheckBoxes' based on Cell Values

    Hi mate

    Have you thought about building this in a Userform?
    It would make the GUI look a bit cleaner.
    Also, I find it easier to control the visibility of objects based on text-box values.

    Cheers
    Dan

    Sorry I haven't answered your question.
    If you were using Userforms, I may be able to help!

  3. #3
    Registered User
    Join Date
    04-26-2013
    Location
    Seattle, Washington
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Hiding / Revealing Form Controls 'CheckBoxes' based on Cell Values

    Thanks Dan!

    No need to apologize, I really appreciate the tip. I'll start looking at building this out as a Userform. I always enjoy learning to do something new.

    Cheers and beers!

    Jason

  4. #4
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: Hiding / Revealing Form Controls 'CheckBoxes' based on Cell Values

    Great!
    If you need a hand with the Userforms, let me know!



    Cheers
    Dan

+ 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] Hiding / Revealing rows based on Cell Value
    By Sky188 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-01-2012, 03:41 PM
  2. Checkboxes (form controls) to gray-out when cells assumes certain value
    By Stefan1983 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-10-2012, 04:31 AM
  3. [SOLVED] Automatically Hiding rows based on checkboxes
    By Jake Bierly in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2012, 06:08 PM
  4. Hiding/Revealing Rows based on a cell value
    By Sky188 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2012, 05:41 PM
  5. Form Controls; setting properties based on cell values
    By Glenn Ray in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-17-2005, 12:06 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