ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create formulas using multiple pop-up input boxes? (https://www.excelbanter.com/excel-programming/445550-create-formulas-using-multiple-pop-up-input-boxes.html)

rcross23

Create formulas using multiple pop-up input boxes?
 
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!

rcross23

Anyone? Bueller? I know someone has to know how to do this.. It would really help me out.

Quote:

Originally Posted by rcross23 (Post 1600064)
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!


merjet

Create formulas using multiple pop-up input boxes?
 
With multiple inputs the best way is likely to add a UserForm in the
VB Editor. Have the macro show it. Put TextBoxes on it for the inputs
to the formula, a CommandButton to trigger calculating the formula,
and a Label to show the result (which you could put elsewhere, e.g. in
a cell).


merjet

Create formulas using multiple pop-up input boxes?
 
If you don't want one UserForm for all the inputs, the macro can show
InputBoxes.
Sub Macro1()
x1 = InputBox("prompt #1")
x2 = InputBox("prompt #2")
'call formula
End Sub



All times are GMT +1. The time now is 11:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com