PDA

View Full Version : Create formulas using multiple pop-up input boxes?



rcross23
03-22-2012, 11:07 AM
Hey guys,

I'm trying to create a macro so that whenever i hit the keys assigned to the macro, it will bring up a serious of pop-up input boxes, so that i can enter data (both numeric and text) and then have it create a pre-defined formula using the information that was entered into the boxes.

For instance, one formula i would like to make a macro for would be =cw_act("X","Y->Z"), where X, Y, and Z would be populated by the input boxes.

Even better would be if the pop-up box would have a pre-populated list of formula options and then depending on which one i select (by number) it would dictate which pop-up boxes I am given and therefore which formula is created.

Any help would be greatly appreciated! Thanks!

CatDaddy
03-22-2012, 11:14 AM
maybe a userform is the way to go?

rcross23
03-22-2012, 11:15 AM
I'm sorry, but I am very new at all of this. Could you walk me through what you are talking about and how I would set that up? Thanks for your quick reply!

CatDaddy
03-22-2012, 11:24 AM
http://contextures.com/xlUserForm01.html

rcross23
03-22-2012, 11:30 AM
thanks, i will try that out. not sure it is exactly what i was looking for though. im thinking more along the lines of "i hit ctrl-p, it pops up a box with 4 options of formulas, i select one by hitting 1-4, then depending on what option i select, it pops up 3 boxes, one after another, prompting me for the different parts of the formula. Then after the third box, it automatically creates the formula in whatever cell i had initially selected."

rcross23
03-23-2012, 07:42 AM
Anyone else have any thoughts or ideas? I know someone has to know how to do this. It would really help me out. Thanks!

mikerickson
03-24-2012, 09:46 AM
It would be easier to help if we knew which formula options you want avaliable.

I would go with a Useform. Rather than entering 1-4, I would have 4 option buttions. Depending on which option the user selected, a different page from a MultiPage control would be shown, allowing the user to enter the arguments for that formula.

Have you looked at Excel's native Insert Function feature? It will handle UDF's and has links to all the descriptions of functions.