Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Radio Bttons (97 SP-2)

    I have a spreadsheet that I want to be able to email by the press of a button.

    In order to do this, I need the spreadsheet to display a form which gives the client the option of whether they are using Notes or Outlook as their emailer. OK, I can display the form (F_Semail), no worries, and the form has 2 radio buttons, one for Notes (RB_Notes), the second for Outlook (RB_Outlook), enclosed by a frame called ET.

    Problem is, when I click on "Send Email" on the form, how can I tell which radio button has been selected?

    I have tried this:
    Dim sNumber As Integer
    sNumber = F_Semail.ET

    But I get a 'type mismatch' error.

    How do I capture the radio button pressed to the variable sNumber?

    Thanks for your help.

  2. #2
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Radio Bttons (97 SP-2)

    Hi Ted,

    You need to check the value of each option button. If it is true, you can assign it to a variable, and use the variable value to do something else...

    See the attached sample and then modify the code as required for your use!
    Regards,
    Rudi

  3. #3
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Radio Bttons (97 SP-2)

    Hi Rudi,
    As an alternative, you can use something like:
    <pre>Select Case True
    Case optNotes
    ' Use Notes code
    Case optOutlook
    ' Use Outlook code
    Case Else
    MsgBox "Please pick an option!"
    End Select
    </pre>

    FWIW.
    Regards,
    Rory

    Microsoft MVP - Excel

  4. #4
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Radio Bttons (97 SP-2)

    Thx Rory...I agree! (Select Case is very under-rated and under-used!)
    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Regards,
    Rudi

Posting Permissions

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