Results 1 to 3 of 3

Storing user input through option button value in another worksheet row by row

Threaded View

  1. #1
    Registered User
    Join Date
    12-26-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    18

    Storing user input through option button value in another worksheet row by row

    Hi
    It is a multiple choice answering project. Results will be displayed once the exercise is completed. I am unable to store the choice selected by the user against each question .

    My code is like this:

    
    Sub CommandButton1_Click()
    Dim Ctr As Long
    
    Ctr = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row
    
    ctr3 = Sheet1.Cells(10, 1).Value
    ctr2 = Sheet1.Cells(10, 1).Value
    
    
    Worksheets("Sheet1").OptionButtons.Enabled = True
    Worksheets("Sheet1").OptionButtons.Value = 0
    
    Sheet1.Cells(1, 3).Value = Sheet2.Cells(ctr2 + 1, 2).Value
    Sheet1.Cells(3, 3).Value = Sheet2.Cells(ctr2 + 1, 3).Value
    Sheet1.Cells(3, 4).Value = Sheet2.Cells(ctr2 + 1, 4).Value
    Sheet1.Cells(3, 5).Value = Sheet2.Cells(ctr2 + 1, 5).Value
    Sheet1.Cells(3, 6).Value = Sheet2.Cells(ctr2 + 1, 6).Value
    Sheet1.Cells(4, 11).Value = Sheet2.Cells(ctr2 + 1, 7).Value
    
    Sheet1.Cells(10, 1).Value = Sheet2.Cells(ctr2 + 1, 1).Value
    
    ctr2 = Sheet1.Cells(10, 1).Value
    ctr3 = Sheet1.Cells(10, 1).Value
    
        If ctr3 = 0 Then
            Sheets("Results").Activate
            ctr2 = 0
            ctr3 = 0
        Exit Sub
        End If
    
    End Sub
    Sub OptionButton1_Click()
    Worksheets("Sheet1").OptionButtons.Enabled = False
    Worksheets("Results").Cells(ctr2 + 2, 9).Value = Sheet1.Cells(4, 10).Value
    End Sub
    Sub OptionButton2_Click()
    Worksheets("Sheet1").OptionButtons.Enabled = False
    Worksheets("Results").Cells(ctr2 + 2, 9).Value = Sheet1.Cells(4, 10).Value
    End Sub
    Sub OptionButton3_Click()
    Worksheets("Sheet1").OptionButtons.Enabled = False
    Worksheets("Results").Cells(ctr2 + 2, 9).Value = Sheet1.Cells(4, 10).Value
    End Sub
    Sub OptionButton4_Click()
    Worksheets("Sheet1").OptionButtons.Enabled = False
    Worksheets("Results").Cells(ctr2 + 2, 9).Value = Sheet1.Cells(4, 10).Value
    End Sub
    After the option button click event the value should be stored in the "RESULTS" sheet in "I" column row by row.
    My code is placing the value in the first row only.

    Please help me in solving the issue
    Attached Files Attached Files

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