ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Option Button Value (https://www.excelbanter.com/excel-programming/323612-option-button-value.html)

ExcelMonkey[_190_]

Option Button Value
 
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

ExcelMonkey[_190_]

Option Button Value
 
Replaced

ContinueButton.Enable = False

With

Userform2.ContinueButton.Enable = False



-----Original Message-----
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
.



All times are GMT +1. The time now is 02:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com