Untick a Checkbox on a userform

J

John

Hi,

I have two useforms. Useform1 has a Checkbox which when ticked opens
Userform2. When Userform2 is closed i would like the tick in the Checkbox in
Userform1 to not be their. How would this be done and where would the code
go please?

Thanks
John
 
M

Mike H

Hi,

I imagine you have used the click event of the checkbox on userform1 to call
userform2 si simply set it to false immediatly after it is checked

Private Sub CheckBox1_Click()
CheckBox1 = False
UserForm2.Show
End Sub

Mike
 
R

Rick Rothstein

I presume your code to show UserForm2 is located in the Click event for the
CheckBox on UserForm1. As long as your code to show UserForm2 looks like
this...

Private Sub CheckBox1_Click()
'
' Other possible code
'
If CheckBox1.Value = True Then UserForm2.Show
'
' Other possible code
'
End Sub

then you can place this code...

Private Sub UserForm_Terminate()
UserForm1.CheckBox1.Value = False
End Sub

in the Terminate event for UserForm2
 
J

Jacob Skaria

Use the Terminate Event of Userform2

Private Sub UserForm_Terminate()
UserForm1.CheckBox1.Value = False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top