ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Forms and Macros (https://www.excelbanter.com/excel-programming/354119-forms-macros.html)

Darin Kramer

Forms and Macros
 
Howdie,

Is it possible to create a form that when you click a button runs a
Macro based on the contents of what has been entered into a form?
If yes...Any ideas how... ?

Regards

D

*** Sent via Developersdex http://www.developersdex.com ***

Bob Phillips[_6_]

Forms and Macros
 
Yes, but we probably need more detail to be specific.

In principle however, you create a macro with arguments, and call that macro
with form elements as the parameters. For example

myMacro Textbox1.Value, Combobox1.Value

and then myMacro looks like

Sub myMacro(val1 As String, val2 As String)
' then use val1 and val2 in here
End Sub

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Darin Kramer" wrote in message
...
Howdie,

Is it possible to create a form that when you click a button runs a
Macro based on the contents of what has been entered into a form?
If yes...Any ideas how... ?

Regards

D

*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 12:15 AM.

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