dialogue box problem

  • Thread starter Thread starter Lynda
  • Start date Start date
L

Lynda

On an excel dialogue box with more than one checkbox is
it possible to ensure that only one of the checkboxes may
be checked at any time.
 
Assuming you are talking about a dialog that is a userform, not a built-in
Excel dialog: if you use optionbuttons instead of checkboxes, it should
automatically force only one at a time to be selected. If you want to use
checkboxes you would have to add some code - a sub like this for each
checkbox would be needed:

Private Sub CheckBox1_Click()

CheckBox2 = False
CheckBox3 = False
....

End Sub
 
I am meaning an excel dialog box with checkboxes built
like this in the code .

--

TopPos = 40
For i = 1 To ActiveWorkbook.Worksheets.Count
Set CurrentSheet = ActiveWorkbook.Worksheets(i)
' Skip empty sheets and hidden sheets
If Application.CountA(CurrentSheet.Cells) <> 0
And _
CurrentSheet.Visible Then
SheetCount = SheetCount + 1
PrintDlg.CheckBoxes.Add 78, TopPos, 150, 16.5
PrintDlg.CheckBoxes(SheetCount).Text = _
CurrentSheet.Name
TopPos = TopPos + 13
End If
Next i

--

if you can shed any light then please do help

Thanks

Lynda
 
Back
Top