M
mooresk257
Hi Folks,
I am trying to use a checkbox to show or hide an additional worksheet. That
part is easy - but what I am also trying to do is call a subroutine (Private
Sub ResetForm_Click() ) on the other worksheet (Sheet7) that resets that
sheet to a particular base state (i.e. removes all images from image boxes,
clears cell contents, moves shapes, etc.) I'm not sure if it is possible to
do, and I only want to delete the info on that specific sheet. I could just
copy and paste the contents of ResetForm_Click into the code for the checkbox
change event, but I'm sure there has to be a better way to call a private
function. Or do I have to make it a public function?
Here's what I have for code so far:
Private Sub CheckBox1_Change()
Dim RemSection As Long
If Sheet3.CheckBox1.Value = True Then
Sheet7.Visible = True
Else
RemSection = MsgBox("Are you sure? Unchecking this box removes all
info from the additional section. This cannot be undone!", vbYesNo)
If RemSection = vbYes Then
Sheet7.Visible = False
Run Sheet7.ResetForm 'This line does not seem to work!
ElseIf RemSection = vbNo Then
Sheet3.CheckBox1.Value = True
End If
End If
End Sub
Any suggestions are most appreciated.
Thanks!
Scott
I am trying to use a checkbox to show or hide an additional worksheet. That
part is easy - but what I am also trying to do is call a subroutine (Private
Sub ResetForm_Click() ) on the other worksheet (Sheet7) that resets that
sheet to a particular base state (i.e. removes all images from image boxes,
clears cell contents, moves shapes, etc.) I'm not sure if it is possible to
do, and I only want to delete the info on that specific sheet. I could just
copy and paste the contents of ResetForm_Click into the code for the checkbox
change event, but I'm sure there has to be a better way to call a private
function. Or do I have to make it a public function?
Here's what I have for code so far:
Private Sub CheckBox1_Change()
Dim RemSection As Long
If Sheet3.CheckBox1.Value = True Then
Sheet7.Visible = True
Else
RemSection = MsgBox("Are you sure? Unchecking this box removes all
info from the additional section. This cannot be undone!", vbYesNo)
If RemSection = vbYes Then
Sheet7.Visible = False
Run Sheet7.ResetForm 'This line does not seem to work!
ElseIf RemSection = vbNo Then
Sheet3.CheckBox1.Value = True
End If
End If
End Sub
Any suggestions are most appreciated.
Thanks!
Scott