I have just spent the most frustrating morning writing some VBA code for a survey that the Senior’s Club sent out to members. As we have over 100 members collating the results was going to be a problem. These were questions posed by a member BTW not the committee.
Setting up the form was easy: (I have corrected the missing question marks)
The problem came when reading the Option Buttons. I have only used them a couple of times before and only 2 or 3… They cannot be set up as an array (or at least I couldn’t find a way) finding their values when you have 22 of the buggers is a problem. It was so frustrating.
I eventually found a way by reading all the controls on the form, if it was an option button then reading its unique name and putting that info into an array… I named each button with a number - for example the top left button is opt11 the one to its right is opt12 and so on the opt is common to all of them the first number is the question the next number is the position in the row. so for example the second question No Opinon option is opt24.
Each question has its own sheet so it was easy to use loops to put the answers on the appropriate sheet
As the results are boolean (true or false) it is easy to total the responses
Why option buttons are so difficult to read I have no idea. I certainly had murderous thoughts toward Bill Gates for a while but am pleased that it now works properly even if it is a bit of a roundabout way of achieving it