I hate you Bill Gates!

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)

Survey Spreadsheet Form

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

Survey Spreadsheet Results

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

1 Like

You can’t blame Bill, it’s probably one of his lackey’s fault!

1 Like

seems you got there in the end. If they didn’t build in problems they wouldn’t be able to keep making money with new versions.

1 Like

Actually I came across the solution quite early on (thank you Mr Google) but I didn’t believe it was the solution because I thought it was so clunky. However after much further searching it seems the only way to do it.

I suppose most of the time you are only dealing with a couple of buttons so you can look at them directly but when you have 20 or so it becomes more complex because you want to loop through them efficiently.

1 Like