Linking Macros

MNuckols

New Member
Joined
Nov 4, 2002
Messages
3
I have a rather difficult macro question. I have put together an electronic quiz that includes macros so that you can "check" the appropriate box. The numbers beside the boxes are listed 1 - 5. I would like to be able to add a formula into my worksheet that will count the 1's, 2's, etc. and give a total at the bottom of my worksheet. Is this possible, and if so, how do I do it? I seems to me that I need to be able to link my macro into the number somehow so that when the corresponding number and box are checked it recognizes the answer. Thanks in advance for your expert knowledge!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
you need to look at the CheckBox.Checked property but this is not my strength! This should bump your message back up though.

Run a search on CheckBoxes on this site and you may well come up with your answer. The difficulty I imagine is getting it to recognize your checkbox position (out of the 5) and referencing it.

e.g
If CheckBox(1).Checked Then TOT = 1
If CheckBox(2).Checked Then TOT = 2

and so on with TOT being your running total.

The other way is link your checkbox (under properties) to a cell - this way you can run the following ifs:

If Sheets("Sheet1").Range("A1")= "TRUE" Then TOT = 1
If Sheets("Sheet1").Range("B1")= "TRUE" Then TOT = 2

and so on...

where you're substituting a test on the checkbox with a test on the linked cell of the checkbox - where TRUE will appear if checkbox is clicked.

Hope this helps a little...

_________________
LASW10
This message was edited by lasw10 on 2002-11-06 02:51
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top