Option Button Value

E

ExcelMonkey

I have a form that is called from a proceding form.
Before the form is called, I load listbox. I also want
set the enable property of a button on the form to FALSE
based on a option button value in a preceding form. The
code below is failing on the OptionButton2.Value = xlOn
line of the code. What is the proper syntax for an
Option BUtton value?

Sub WorkSheetSummary()
Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets
If ws.Visible = True Then
WorkSheetSelectForm.ListBox1.AddItem (ws.Name)
End If
Next

If OptionButton2.Value = xlOn Then
ContinueButton.Enable = False
End If

WorkSheetSelectForm.Show

End Sub

Thanks
 
E

ExcelMonkey

Replaced

ContinueButton.Enable = False

With

Userform2.ContinueButton.Enable = False
 

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