ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Untick a Checkbox on a userform (https://www.excelbanter.com/excel-programming/430795-untick-checkbox-userform.html)

John

Untick a Checkbox on a userform
 

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


Mike H

Untick a Checkbox on a userform
 

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

"John" wrote:

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


Rick Rothstein

Untick a Checkbox on a userform
 

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

--
Rick (MVP - Excel)


"John" wrote in message
...
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



Jacob Skaria

Untick a Checkbox on a userform
 

Use the Terminate Event of Userform2

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


--
If this post helps click Yes
---------------
Jacob Skaria


"John" wrote:

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



All times are GMT +1. The time now is 09:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com