I have created a form that allows a user to select multiple classes via a check box. Each Check box has a corresponding worksheet. What I am needing is code that will unhide the worksheet when the Checkbox is selected. Can anyone help. thx -asa
That works great, thank you very much. BTW I went with the IF THEN ELSE statement. One more questions now. On my form, to unload the form I have Unload Me, that clears all the Check Boxes. Is there a way to keep them checked when the form is unloaded?On 2002-10-24 14:12, jmiskey wrote:
If your check box is named "CheckBox1", and if the sheet you are unhiding is "Sheet1", place the following code in the code section on the form.
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
Sheets("Sheet1").Visible = True
End If
End Sub
Repeat for other check boxes. You could also add an "Else" statement setting the .Visible property to False if you want to rehide the sheet if they uncheck the box.
On 2002-10-24 15:07, Aaron wrote:
That works great, thank you very much. BTW I went with the IF THEN ELSE statement. One more questions now. On my form, to unload the form I have Unload Me, that clears all the Check Boxes. Is there a way to keep them checked when the form is unloaded?On 2002-10-24 14:12, jmiskey wrote:
If your check box is named "CheckBox1", and if the sheet you are unhiding is "Sheet1", place the following code in the code section on the form.
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
Sheets("Sheet1").Visible = True
End If
End Sub
Repeat for other check boxes. You could also add an "Else" statement setting the .Visible property to False if you want to rehide the sheet if they uncheck the box.
On 2002-10-24 16:36, jmiskey wrote:
If you just care about holding the value while the file is open, use Brett's suggestion of hiding the form instead of unloading it. It is much easier.
If you want to save the selections from the previous time the file was open, you could store information like I mentioned in the previous e-mail (I haven't actually attempted to do this yet, so I am unaware if there are any "tricks" involved).
I am afraid I do not understand what you were asking is the last reply, and if it was in reference to my reply or Brett's.