+ Reply to Thread
Results 1 to 4 of 4

Capture Option Button selections on user form

  1. #1
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Capture Option Button selections on user form

    I have the following option buttons within a frame on a user form. I storing the value of the option button that passes as true. The text "Test 1, Test 2......" is then passed to the corresponding worksheet.

    I would also like to capture which option button passes as true so that the corresponding text is stored to a variable.

    I attempted to create the myChange variable placed at the top of the module, then i was planning on calling the variable from another sub routine, to do some further evaluation.

    Please Login or Register  to view this content.
    The second sub routine is per the following

    Please Login or Register  to view this content.
    The macro fails on the myVerify(6) = myChange(1) line, the error is "Sub or Function not defined", obviously i've done something wrong with the myChange variable, could someone explain what is wrong and suggestions on correcting this.

    Thanks
    Last edited by jprlimey; 07-22-2014 at 11:43 AM. Reason: Solved

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: Capture Option Button selections on user form

    myChange is not defined in the sub VerifyOkay.
    you defined it in the 1st block.

  3. #3
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Re: Capture Option Button selections on user form

    When i put the following code into the 2nd block everything is fine, but this would seem to be a waste of coding as i'm basically repeating code from the first block, so is their a method of defining the variables in the first block that the second block gets the required data?

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Re: Capture Option Button selections on user form

    I think i figured it out.

    I change the following to the first sub routine

    Please Login or Register  to view this content.
    Then changed the second sub routine

    Please Login or Register  to view this content.
    Then changed the myChange variable to myRev

    Please Login or Register  to view this content.
    Thanks all for pointing me in the right direction.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Capture changes to User Form selections when compared to initial inputs
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2014, 05:23 PM
  2. [SOLVED] Disable option button on user form??????
    By Bflare in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-27-2014, 04:42 PM
  3. vba user form to create message depend on option button/check box
    By young_86 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2013, 06:12 AM
  4. VBA User Form - Option Button
    By nivassrii in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-26-2011, 06:18 AM
  5. Writing a user form's option button value to Notepad
    By deadlyduck in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2010, 01:57 AM

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