Linking Radio Buttons for Test

Discussion in 'Other Software' started by LordVankar, May 11, 2012.

  1. LordVankar

    LordVankar

    Joined:
    May 10, 2012
    Likes Received:
    0
    I have been reading a lot of comments on how to use radio buttons and have been seeing a lot fo different versions. What I am looking for is a scoring system. So in my worksheet which I cannot seem to attach, I have inserted the Group Box and four option buttons, each located in cells k19,20,21 and 22 I want the option buttons to link to cell K18, with the answer of A,B,C, or D. I have only provided one set as once I get the code for it I am sure I can copy the rest.
     
    LordVankar, May 11, 2012
    #1
    1. Advertisements

  2. LordVankar

    Stoneboysteve

    Joined:
    Sep 3, 2008
    Likes Received:
    4
    Location:
    USA
    Create the radio buttons then shift click to select them, right click and group them.
    Right click on the first one, select format control, select the cell you want to link.
    When I just tested it with a group of four buttons the linked cell values were 1, 2, 3, and 4.

    Steve
     
    Stoneboysteve, May 12, 2012
    #2
    1. Advertisements

  3. LordVankar

    LordVankar

    Joined:
    May 10, 2012
    Likes Received:
    0
    Thanks. That worked, but I need to change the numbers to letters, which I managed but not the way it should be. See code below. If I had a separate subroutine for each radio button then it would work, but when they are combined under the same subroutine, it only comes up with one of the letters, and it comes up with an error stating that it "can't execute in break mode." Perhaps you know how to shorten this and make it a simpler code?

    Sub QUESTION_1()
    '
    ' QUESTION_1 Macro
    '
    '
    ActiveSheet.Shapes("1A").Select
    If Range("K18").Select Then
    ActiveCell.FormulaR1C1 = "A"

    Else

    ActiveSheet.Shapes("1B").Select
    If Range("K18").Select Then
    ActiveCell.FormulaR1C1 = "B"

    Else

    ActiveSheet.Shapes("1C").Select
    If Range("K18").Select Then
    ActiveCell.FormulaR1C1 = "C"

    Else

    ActiveSheet.Shapes("1D").Select
    If Range("K18").Select Then
    ActiveCell.FormulaR1C1 = "D"
    End If
    End If
    End If
    End Sub
     
    LordVankar, May 14, 2012
    #3
  4. LordVankar

    LordVankar

    Joined:
    May 10, 2012
    Likes Received:
    0
    I have it figured out, but only if each of the buttons have their own subroutine but are linked to the same cell. So if there is another way that someone knows to combine those into one subroutine, that would be appeciated.

    Sub Button_1A()
    ActiveSheet.Shapes("1A").Select
    Range("K18").Select
    ActiveCell.FormulaR1C1 = "A"

    End Sub

    Sub Button_1B()
    ActiveSheet.Shapes("1B").Select
    Range("K18").Select
    ActiveCell.FormulaR1C1 = "B"

    End Sub
    Sub Button_1C()
    ActiveSheet.Shapes("1C").Select
    Range("K18").Select
    ActiveCell.FormulaR1C1 = "C"

    End Sub
    Sub Button_1D()
    ActiveSheet.Shapes("1D").Select
    Range("K18").Select
    ActiveCell.FormulaR1C1 = "D"

    End Sub
     
    LordVankar, May 14, 2012
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Abarbarian

    BBC iPlayer - Radio Downloader

    Abarbarian, Jan 9, 2011, in forum: Other Software
    Replies:
    6
    Views:
    8,418
    floppybootstomp
    Feb 11, 2011
  2. SunbeamFanatic

    Outlook Linking Hotmail to Outlook

    SunbeamFanatic, Mar 15, 2011, in forum: Microsoft Office
    Replies:
    1
    Views:
    1,327
    Silverhazesurfer
    Mar 24, 2011
  3. snoopy12

    Excel Excel Linking to Access - Chart doesn't update

    snoopy12, Jul 19, 2011, in forum: Microsoft Office
    Replies:
    1
    Views:
    577
    apr pillai
    Jul 23, 2011
  4. joannesmithers

    Excel linking outlook emails to excel

    joannesmithers, Dec 12, 2011, in forum: Microsoft Office
    Replies:
    0
    Views:
    2,136
    joannesmithers
    Dec 12, 2011
  5. LordVankar

    RADIO BUTTON LINKS SWITCHING BACK TO NUMBER

    LordVankar, May 14, 2012, in forum: Other Software
    Replies:
    1
    Views:
    638
    LordVankar
    May 14, 2012
  6. Quadophile

    Peacekeeper - The ultimate browser test

    Quadophile, Apr 16, 2013, in forum: Other Software
    Replies:
    12
    Views:
    1,419
    Quadophile
    Apr 17, 2013
  7. Lazarusomega2000

    Access Test Building Application in Access 2007/2010

    Lazarusomega2000, May 13, 2013, in forum: Microsoft Office
    Replies:
    0
    Views:
    728
    Lazarusomega2000
    May 13, 2013
  8. Jack9307

    Excel Linking Excel and Powerpoint.

    Jack9307, May 12, 2015, in forum: Microsoft Office
    Replies:
    0
    Views:
    235
    Jack9307
    May 12, 2015
Loading...