H
hiryu
Hello,
I'm a newbie to Word Macro, I'm writing a macro using a custom dialog
box. I want to set some value to a variable during initialize, and to
make that variable and it's value to other Sub, eg after clicking a
button the process require to access the that variable and it's value.
Here is my simplfied code to demonstrate my idea:
Sub Button_Click()
MsgBox (x)
End Sub
Sub UserForm_Initialize()
x = "hello"
End Sub
First I want to assign a value to "x" during initalizing the userform,
then when I click a button to popup a message box and show the "x"
value. I've tried using public, static in declaration but no luck, the
value couldn't be transferred to other Sub. Could someone tell me to
solve this please?
Thanks
I'm a newbie to Word Macro, I'm writing a macro using a custom dialog
box. I want to set some value to a variable during initialize, and to
make that variable and it's value to other Sub, eg after clicking a
button the process require to access the that variable and it's value.
Here is my simplfied code to demonstrate my idea:
Sub Button_Click()
MsgBox (x)
End Sub
Sub UserForm_Initialize()
x = "hello"
End Sub
First I want to assign a value to "x" during initalizing the userform,
then when I click a button to popup a message box and show the "x"
value. I've tried using public, static in declaration but no luck, the
value couldn't be transferred to other Sub. Could someone tell me to
solve this please?
Thanks