Processing groupbox values

R

Ray C

My client has a questionnaire-type of Excel worksheet whereby each row has a
question with a multiple-choice answer. Each row has a groupbox with three
radio buttons and users must select one.

My job is to compile answered. In other words, count how many people chose
the first radio button, how many chose the second and how many chose the
third.

Column A of the worksheet has unique identifiers so I know which question
correcsponds to which row. For example, in cell A45 I have the text "3.4.4".
This corresponds to question 3.4.4 in the questionnaire.

How do I use VBA code to search, for example, what answer was given on that
line?
 
J

JLGWhiz

Depends on what degree of detail you are looking for. Personally, I would
only want to know if the question was answered correctly or incorrectly. But
the principle is the same. The logic that I would use would be If button 1
is true then counter = counter + 1. This logic can be applied to each
button. You would need a place to store the counter information, like a cell
in a hidden sheet. So, instead of counter, you could use a cell reference
like If button 1 = True then Sheets("Hidden").Range("A1") =
Sheets("Hidden").Range("A1") + 1. That way, when the questionaire is
completed the results are completed.
 
R

Ray C

Hmmm, you're giving me another perspective on this.
Ok, so you suggest I use the following code:

If Button1 = true then
'/// Place the counter in a hidden sheet.
Endif

Actually, a better approach would be to place a 1 , 2, or 3 in a hidden
column on the same worksheet. That way, I will know the answer for each line
(question).

But how does excel know which line I'm refering to when I say Button1? There
is a Button1 on each line in the worksheet.

Is there a way to get the line number of a given button? Or a given group box?

Thanks!
Ray
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top