send sub routine variable to global

  • Thread starter Thread starter Nigel
  • Start date Start date
N

Nigel

so in a subroutine, i set a variable in the middle of script, and
aftewards, i wanted to use that variable globally....can i take a
variable and set a global variable with it from inside a subroutine?
 
Hi
Declare the variable outside the sub at the top of the module, but
define it as you did inside the sub.
Then
Dim myVariable
at the top of the sub can be used inside that module.
Also
Public myVariable
at the top of the sub can be used inside the project

regards
Paul
 
Make it a function and return that value as the function result to the
caller.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top