Results 1 to 4 of 4

Capture Option Button selections on user form

Threaded View

  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.

    Dim myChange (1 to 40) as Variant
    
    If OpbTypeOne = True Then
            ws.Cells(2, 5).Value = "Test 1"
            myChange(1) = "Test 1"
        End If
    
        If OpbTypeTwo = True Then
            ws.Cells(2, 5).Value = "Test 2"
            myChange(1) = "Test 2"
        End If
    The second sub routine is per the following

    Sub VerifyOkay()
    
    Dim myVerify(1 To 40) As Variant
    
        myVerify(1) = txtPlanningNo.Value
        myVerify(2) = cboEngineer.Value
        .
        .
        .
        myVerify(6) = myChange(1)
    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

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