Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you both; got it working! Really appreciate the assistance.
"Dave Peterson" wrote: You sure you're looking at the correct sheet? And if you do have an event that fires when you make a change, maybe you want something like: Private Sub OKButton_Click() If CheckBoxClearCS.Value = True Then 'why select Application.EnableEvents = False Worksheets("MMS for CS").Range("O3").ClearContents Application.EnableEvents = true Else MsgBox "Not checked" Worksheets("MMS for CS").select Range("A1").Select End If CheckBoxClearCS.Value = 0 AskReClearData.Hide End Sub Paige wrote: Can someone advise why this doesn't work; the userform (AskReClearData) shows up okay, but when I check the 'CheckBoxClearCS' within the form (done in a frame via the Control Toolbox) and then hit ok, the code essentially skips the 5th line (re clear contents). If the checkbox is NOT selected and I hit OK, then the code runs correctly. Private Sub OKButton_Click() Application.EnableEvents = True If CheckBoxClearCS.Value = True Then Worksheets("MMS for CS").Activate Range("O3").ClearContents Else MsgBox ("Not checked") Worksheets("MMS for CS").Activate Range("A1").Select End If CheckBoxClearCS.Value = 0 AskReClearData.Hide End Sub -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to clear all checkboxes on a form? | Excel Worksheet Functions | |||
Form Checkboxes are not maintaining cell link | Excel Discussion (Misc queries) | |||
Adding Checkboxes to a Form | Excel Programming | |||
VBA Beginner: Help with Checkboxes on created User Form | Excel Programming | |||
How to keep the Checkboxes selected by the user unchanged even after closing the userform | Excel Programming |