+ Reply to Thread
Results 1 to 6 of 6

Thread: Difference between Workbook Macros and Global Macros?

  1. #1
    Registered User
    Join Date
    07-03-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Difference between Workbook Macros and Global Macros?

    Hey,

    I was just wondering if someone could please tell me the difference between Workbook Macros and Global Macros?

    I'm trying to figure it out by searching on search engines, but I can't seem to understand.

    Thanks in advance

  2. #2
    Registered User
    Join Date
    06-29-2011
    Location
    California
    MS-Off Ver
    Excel 2003/2007
    Posts
    58

    Re: Difference between Workbook Macros and Global Macros?

    I'm assuming you mean workbook macros as macros that are available in your ThisWorkbook (default workbook module), and global macros as user added modules that contain macros? Or do you mean private/public subroutines/functions?

    You can define macros as public or private..

    Public sub xyz()
    end sub
    
    Private Sub xyz()
    
    end sub
    When they're set to private, they do not appear in your macro list editor. They also cannot be called just by referring to the 'xyz' name unless they actually exist in the same module - such as;

    Call xyz
    Basically, private hides the macro from your alt + f8 list, and makes it more difficult to refer to the function, or sub you have defined as private.

    As far as functionality, there's not much difference.

  3. #3
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,300

    Re: Difference between Workbook Macros and Global Macros?

    Hi Peter Me and welcome to the forum,

    This link discribes what I think you are asking:

    http://www.cpearson.com/excel/codemods.htm

    If you were asking about Public or Private variables here is a good link:
    http://www.ozgrid.com/VBA/variable-scope-lifetime.htm
    One test is worth a thousand opinions.
    Click the * below to say thanks.

  4. #4
    Registered User
    Join Date
    07-03-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Difference between Workbook Macros and Global Macros?

    @ DocMed

    Hey,

    I need to explain what these different automation techniques are used for and why I would use one for a particular task rather than the other technique. Do you have any ideas about that?

    Thanks in advance.
    Last edited by shg; 07-03-2011 at 03:13 PM. Reason: deleted quote

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Apparently I can't say
    MS-Off Ver
    Apparently I can't say
    Posts
    8,274

    Re: Difference between Workbook Macros and Global Macros?

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    Read this to understand why we ask you to do this.

    Please add links to all your cross posts in other forums to your original post here.

  6. #6
    Registered User
    Join Date
    06-29-2011
    Location
    California
    MS-Off Ver
    Excel 2003/2007
    Posts
    58

    Re: Difference between Workbook Macros and Global Macros?

    @ peter me - I can't make a recommendation unless I actually know what you want to accomplish.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0