How can I (if it's possible at all) set the value of a variable being used in one workbook, and have that variable retain its value in a sub in a different work book. eg..
sub code1()
x = 5
application.run("'Path\of\different\workbook\name.xlsm'!code2")
end sub
[then in the other work book]
sub code2()
x = x +1
end sub
...so that at the end of sub code2, x will equal 6
i've tried declaring x using public and global, but this doesn't do the trick..
any help is appreciated
sub code1()
x = 5
application.run("'Path\of\different\workbook\name.xlsm'!code2")
end sub
[then in the other work book]
sub code2()
x = x +1
end sub
...so that at the end of sub code2, x will equal 6
i've tried declaring x using public and global, but this doesn't do the trick..
any help is appreciated