Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I set the default recalculate option to automatic? Neil Excel Discussion (Misc queries) 7 June 15th 09 08:33 AM
how do i set the default sort option to recognize a header marquize Excel Discussion (Misc queries) 1 July 7th 06 04:54 PM
keep source formatting is not an option in paste option button Tina Excel Discussion (Misc queries) 0 February 20th 06 09:58 PM
How do I set the default paste option? Forester Setting up and Configuration of Excel 0 November 30th 05 07:35 PM
How do I set the Default Paste Option ForesterFan Setting up and Configuration of Excel 0 June 18th 05 05:30 PM


All times are GMT +1. The time now is 03:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"