ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sub, Private Sub, Public Sub (https://www.excelbanter.com/excel-programming/441702-re-sub-private-sub-public-sub.html)

Mike Rogers[_2_]

Sub, Private Sub, Public Sub
 
Thanks for the explainations guys, now I will try to figure out why they
worked on one machine and not the other! They are all stand alone macros.

Mike Rogers

"Chip Pearson" wrote:

It is a matter of what is called "scope". See
http://www.cpearson.com/excel/scope.aspx for a full discussion of
scope as it applies to both variables and procedures.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com



On Wed, 14 Apr 2010 21:11:02 -0700, Mike Rogers
<Mike060349@NoxSpamxAOLDOTcom wrote:

I got a different lap top and when I moved my Personal.xls from one to the
other some of my macros were not on the list of macros when you go to
toolsmacros. Although when I look in the code they are there. I figured
out that the ones that were "Private Sub" macros were no working. I also
figured that when I changed them to just "Sub" they worked. I do know that
if "It aint broke don't fix it, cus to try is usually to fix it till it is
broke." But what is the difference between "Sub", "Private Sub", & "Public
Sub"?

Mike Rogers
xl2k on windows 7

.



All times are GMT +1. The time now is 10:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com