Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Option Button as default
I have the following Form set up to help others access specific files. Is
there a way to make Option Button 2 the default should user not make a selection? Private Sub OK_Click() If OptionButton1 Then For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then Workbooks.Open Filename:="\\Fl-msjf-fs1\Data\Data\RECOVERY\EXLDATA\Loan Recovery MIS\Budget\2004" & ListBox1.List(i) & "P&L.xls" End If Next i Unload UserForm9 Range("A1").Select End If If OptionButton2 Then For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then Workbooks.Open Filename:="\\Fl-msjf-fs1\Data\Data\RECOVERY\EXLDATA\Loan Recovery MIS\Budget\2005" & ListBox1.List(i) & "P&L.xls" End If Next i Unload UserForm9 Range("A1").Select End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Option Button as default
Just set the Value property of OptionButton2 to True in design mode. Then
unless the user selects OptionButton1, the OptionButton2 will remain selected. Alok Joshi "StephanieH" wrote: I have the following Form set up to help others access specific files. Is there a way to make Option Button 2 the default should user not make a selection? Private Sub OK_Click() If OptionButton1 Then For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then Workbooks.Open Filename:="\\Fl-msjf-fs1\Data\Data\RECOVERY\EXLDATA\Loan Recovery MIS\Budget\2004" & ListBox1.List(i) & "P&L.xls" End If Next i Unload UserForm9 Range("A1").Select End If If OptionButton2 Then For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then Workbooks.Open Filename:="\\Fl-msjf-fs1\Data\Data\RECOVERY\EXLDATA\Loan Recovery MIS\Budget\2005" & ListBox1.List(i) & "P&L.xls" End If Next i Unload UserForm9 Range("A1").Select End If End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Option Button as default
Perfect.
Thanks Alok. "Alok" wrote: Just set the Value property of OptionButton2 to True in design mode. Then unless the user selects OptionButton1, the OptionButton2 will remain selected. Alok Joshi "StephanieH" wrote: I have the following Form set up to help others access specific files. Is there a way to make Option Button 2 the default should user not make a selection? Private Sub OK_Click() If OptionButton1 Then For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then Workbooks.Open Filename:="\\Fl-msjf-fs1\Data\Data\RECOVERY\EXLDATA\Loan Recovery MIS\Budget\2004" & ListBox1.List(i) & "P&L.xls" End If Next i Unload UserForm9 Range("A1").Select End If If OptionButton2 Then For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then Workbooks.Open Filename:="\\Fl-msjf-fs1\Data\Data\RECOVERY\EXLDATA\Loan Recovery MIS\Budget\2005" & ListBox1.List(i) & "P&L.xls" End If Next i Unload UserForm9 Range("A1").Select End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I set the default recalculate option to automatic? | Excel Discussion (Misc queries) | |||
how do i set the default sort option to recognize a header | Excel Discussion (Misc queries) | |||
keep source formatting is not an option in paste option button | Excel Discussion (Misc queries) | |||
How do I set the default paste option? | Setting up and Configuration of Excel | |||
How do I set the Default Paste Option | Setting up and Configuration of Excel |