VBA Question-and-Answer Type Macro (Mathematical)

danb3345

New Member
Joined
Jun 27, 2011
Messages
2
Hello,

I am looking to write a code in VBA Excel such that:

1. A series of questions on a spreadsheet are asked, where numerical answers are filled-in in the adjecent cell. Eg. How many balloons? 6

2. A button below the list of questions reads ''Calculate'' and runs a specified mathematical calculation based on the numerical answers above when clicked. The answer is displayed either in a cell on the spreadsheet or in a pop-up window.

The reason I want a macro for this instead of just simply formulating the equation within the spreadsheet is that I do not want the ''answer'' to apparently change as the values are added in. I want the answer only to appear upon clicking of the mouse.

If anyone knows a link to a good tutorial or anything in general that may assist me with this it would be appreciated.

Thank you in advance and I apologize for the most certain reduncy of the nature of my question.

Dan
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Well..
You can google "VBA tutorials" as there are some good websites you can just find.
For this question, I think you must use something called
"Click" Event.

It means whenever an object is clicked, the code inside the event will be executed.
So, if a button is called cmdBtn
Code:
Private Sub cmdBtn_Click()
 'Your code
End Sub

should do the trick.
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,473
Members
452,915
Latest member
hannnahheileen

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