![]() That is how you pass a numeric argument to the macro simply put a space after the name of the macro and type the number. Notice the 5 after the name of the macro. The name of the macro will not appear in the window so we must type it in under where it says Macro name. Note: the text is surrounded by double quotation marks and then the entire thing is surrounded by single quotation marks. Type in the name of the macro and then a space and then the value that you want to send to the macro. ![]() We must type in the name of the macro and then also the value for the argument. Hit Alt + F8 to get to the Run Macro window: When you go to run this macro from the worksheet Excel interface, you will actually not see it in the list of available macros. This macro accepts a value in the message variable and then outputs it into a message box pop-up. 'output a message that is given to this macro Here is our sample macro: Sub show_msg(message) To allow a macro to accept a value, you simply type a name for that value between the parentheses at the top of the macro. Notes Create the Macro to Accept the Value Sections:Ĭall the Macro from a Button or Other Object/Shape This is different than passing a value from one macro to another. How to pass arguments and values to macros called from worksheets, buttons, and anything else from the Excel interface.
0 Comments
Leave a Reply. |