justagrunt
Technical User
- Oct 10, 2002
- 132
Hi,
if i have some checkboxes on a spreadsheet (created by the controlbox wizard,15 of them) and the user selects them and inadvertently saves and then exits, how can I reset those checkboxes so that when the next user opens the sheet that all checkboxes are returned to zero.
Example
Check1 is true causes check2 and check 3 to be hidden.
If check 2 selected check1 and check 3 hidden.
Check 3 causes check1 and check 2 to be hidden.
If any of them are unchecked all checkboxes become visible.
if the sheet is saved with any of these set, when the sheet is reopened, only that checkbox is visible and set.
What i would like to do is ensure that the sheet is fresh on open.
Is this possible,
I have tried the following unsuccessfully.
Sub ClearAllCB()
Dim oleCheck As OLEObject
For Each oleCheck In Sheet1.OLEObjects
If TypeName(oleCheck.Object) = "CheckBox" Then
oleCheck.Object.Visible = True
oleCheck.Object.Value = False
End If
Next oleCheck
End Sub
I have even tried worksheets(1).check1.visible=true
and so on to make all visible and
worksheets(1).check1=false etc to reset
all to no avail.
any Ideas?
Kind Regards
bill
if i have some checkboxes on a spreadsheet (created by the controlbox wizard,15 of them) and the user selects them and inadvertently saves and then exits, how can I reset those checkboxes so that when the next user opens the sheet that all checkboxes are returned to zero.
Example
Check1 is true causes check2 and check 3 to be hidden.
If check 2 selected check1 and check 3 hidden.
Check 3 causes check1 and check 2 to be hidden.
If any of them are unchecked all checkboxes become visible.
if the sheet is saved with any of these set, when the sheet is reopened, only that checkbox is visible and set.
What i would like to do is ensure that the sheet is fresh on open.
Is this possible,
I have tried the following unsuccessfully.
Sub ClearAllCB()
Dim oleCheck As OLEObject
For Each oleCheck In Sheet1.OLEObjects
If TypeName(oleCheck.Object) = "CheckBox" Then
oleCheck.Object.Visible = True
oleCheck.Object.Value = False
End If
Next oleCheck
End Sub
I have even tried worksheets(1).check1.visible=true
and so on to make all visible and
worksheets(1).check1=false etc to reset
all to no avail.
any Ideas?
Kind Regards
bill