+ Reply to Thread
Results 1 to 3 of 3

Option Button as default

Hybrid View

Guest Option Button as default 05-17-2005, 09:06 AM
Guest RE: Option Button as default 05-17-2005, 10:06 AM
Guest RE: Option Button as default 05-17-2005, 10:06 AM
  1. #1
    StephanieH
    Guest

    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. #2
    Alok
    Guest

    RE: 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. #3
    StephanieH
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1