+ Reply to Thread
Results 1 to 2 of 2

Check Box

  1. #1
    John
    Guest

    Check Box

    I currently have two buttons. One that will show the hidden rows, the other
    that will hide them again. However, i would rather change the two buttons to
    a check box. So if the check box is "Checked" it will show the hidden cells,
    but if it is unchecked it will hide the cells again. I assume that is
    possible.

  2. #2
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Hi John,

    Here's some code for a check box (originally sourced from Aaron Blood's highlight.zip file at http://www.xl-logic.com/pages/vba.html):

    Private Sub CheckBox1_Click()
    If Sheets(1).CheckBox1 Then
    'your code for unhiding rows
    else
    'your code for hiding rows
    End If
    End Sub

    Nb: depending on your preference/caption in your check box, it may be better around the other way. (edit: just re-read your post & have flicked comments around)

    Or another option is just to turn one of your two buttons into a toggle & delete the other one. Have a look at thread below for ideas to adapt:
    http://excelforum.com/showthread.php...=toggle+button

    hth
    Rob Brockett
    NZ
    Always learning & the best way to learn is to experience...
    Last edited by broro183; 04-24-2006 at 11:01 PM.

+ 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