Public vs Global

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have noticed that I can declare a variable "Public" or "Global".

What is the difference between the two?
Is there any advantage of using one over the other?

Thanks in advance.
 
quartz said:
I have noticed that I can declare a variable "Public" or "Global".

What is the difference between the two?
Is there any advantage of using one over the other?

There is no difference in effect between the two. The Global keyword is
a holdover from earlier versions of the BASIC. Most VB/VBA programmers use
Public.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm
 
I believe Global is retained for compatibility. Should be no difference.
 

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