Userform Checkbox question

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,604
Office Version
  1. 365
Platform
  1. Windows
Hi all

I use the following simple code to clear my userform each time the user 'adds' some data (this is done by selecting the add button)
Code:
Sub Clear()
'clear the data
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.ComboBox1.Value = ""
Me.ComboBox2.Value = ""
Me.ComboBox3.Value = ""
Me.ComboBox4.Value = ""
Me.ComboBox5.Value = ""
Me.ComboBox6.Value = ""
Me.ComboBox7.Value = ""
Me.ComboBox8.Value = ""
Me.ComboBox9.Value = ""
Me.CheckBox1.Value = ""
Me.CheckBox2.Value = ""
Me.CheckBox3.Value = ""
If CheckBox1 = True Then
CheckBox1 = False
If CheckBox2 = True Then
CheckBox2 = False
If CheckBox3 = True Then
CheckBox3 = False
End If
End If
End If

Me.Hide
ActiveWorkbook.Save
Sheets("front").Select
added.Show
End Sub
however when the userform is displayed again the three checkbox(s) are populated with tick and are all 'grayed out' - I want them empty ie unchecked

can the above code be changed to reflect this?
many thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Guess it was just as simple as
Code:
CheckBox1.Value = False
CheckBox2.Value = False
CheckBox3.Value = False

:laugh:

thanks anyway !
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top