+ Reply to Thread
Results 1 to 11 of 11

Show/Hide Checkbox

  1. #1
    Registered User
    Join Date
    09-16-2008
    Location
    Chicago, IL
    Posts
    30

    Show/Hide Checkbox

    Excel 2007

    Trying to achieve this:

    IF A1 is not equal to null
    THEN show the checkbox
    ELSE hide the checkbox

    I have to do this for 10 other checkboxes for the data in A1:A10.

    Thanks in advance!

    --Kalyan
    Last edited by kalyanverma; 01-12-2011 at 01:46 PM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Show/Hide Checkbox

    Assuming your check boxes are named Check Box 1 through to Check Box 10 this should work:

    Please Login or Register  to view this content.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    09-16-2008
    Location
    Chicago, IL
    Posts
    30

    Re: Show/Hide Checkbox

    Thanks Dom,

    It works when I try this on a new workbook. I'm having a hard time using it on my existing workbook.

    I have 125 check boxes
    Check Box 479 to Check Box 603
    I want them to show/hide based on values in Cells L12 to L136.

    Ex:

    IF L12 is not null THEN show Check Box 479 ELSE hide Check Box 479
    IF L13 is not null THEN show Check Box 480 ELSE hide Check Box 480
    and so on...till L136 and Check Box 603

    Any specific code?

    Thanks in advance!

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Show/Hide Checkbox

    Similar code adjusted as you decribe:

    Please Login or Register  to view this content.

    Dom
    Last edited by Domski; 01-12-2011 at 10:59 AM.

  5. #5
    Registered User
    Join Date
    09-16-2008
    Location
    Chicago, IL
    Posts
    30

    Re: Show/Hide Checkbox

    Dom,

    unable to get this working. Attached is an example. Can you check what am I missing?

    Thanks
    Attached Files Attached Files

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Show/Hide Checkbox

    Works okay for me.

    If you press Delete on each cell in F2:F6 it will hide the check box and then entering something will cause it to appear again.

    Dom

  7. #7
    Registered User
    Join Date
    09-16-2008
    Location
    Chicago, IL
    Posts
    30

    Re: Show/Hide Checkbox

    It works for me now. However, when I copy paste a range into F2:F6, it throws a Run-time error '13' Type mismatch. And when I do a Debug, it highlights "If Target.Value <> "" Then" part of the code.

  8. #8
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Show/Hide Checkbox

    I think you either need to limit the user to changing one cell at a time like in my previous example or loop through each cell in the cells that are changed like this:

    Please Login or Register  to view this content.

    Dom

  9. #9
    Registered User
    Join Date
    09-16-2008
    Location
    Chicago, IL
    Posts
    30

    Re: Show/Hide Checkbox

    Wonderful. Works like a charm.
    Don't want to bug you anymore, but one last question.

    Can we dynamically change the underlying hyperlink of a cell?

    Ex:

    A1: Text (underlying hyperlink mapped to A2)
    A2: www.google.com

    When the hyperlink is changed in A2, the underlying hyperlink should also be changed in A1.

    Thanks

  10. #10
    Registered User
    Join Date
    09-16-2008
    Location
    Chicago, IL
    Posts
    30

    Re: Show/Hide Checkbox

    Got it. Guess I have to use the HYPERLINK function. Thanks

  11. #11
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Show/Hide Checkbox

    Aye, that's the one.

    Laters,

    Dom

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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