dialogue box problem

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.
 
G

Guest

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
 
L

lynda

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top