+ Reply to Thread
Results 1 to 2 of 2

how to call a Private Sub ?

  1. #1
    Registered User
    Join Date
    02-09-2005
    Posts
    63

    how to call a Private Sub ?

    I want to call a private sub that is "in" a sheet (because it is intimately associated with events on the sheet) from a general module without exposing the private sub to Tools -> Macro -> Macro drop-down.

    Can it be done? If so, how?

    Thanks.

    ****

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Dpenny,

    Private is a keyword that controls the scope of a procedure. All other procedures on the same worksheet can call each other whether they are public or private. Only public sub and functions are accessible outside of the worksheet they were created on.

    The only procedures that are excluded from the MacroDropdown List are procedures that require arguments. My assumption about the logic behind this is if a macro is assigned to a button control how could you pass needed arguments once the macro was run. So, the only way I can see is have your Sub take a dummy argument and declare it as Optional.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

+ 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.6.0 RC 1