+ Reply to Thread
Results 1 to 4 of 4

Call Public Sub From Worksheet VBA

  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Call Public Sub From Worksheet VBA

    I am using the
    Please Login or Register  to view this content.
    event, and rather than copy/paste code from a module into the worksheet event, I was wondering if I could call my event
    Please Login or Register  to view this content.
    from the Worksheet?

    Obviously the _SelectionChange is in the VBA for a worksheet, and GetIt() is in a standard module.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Call Public Sub From Worksheet VBA

    Yes, you can call public sub routines from a private event.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Call Public Sub From Worksheet VBA

    Quote Originally Posted by JBeaucaire View Post
    Yes, you can call public sub routines from a private event.
    Would I just call it like so
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-18-2014
    Location
    australia
    MS-Off Ver
    2015
    Posts
    43

    Re: Call Public Sub From Worksheet VBA

    just
    Please Login or Register  to view this content.
    it's redundant but i always use Call since it's closer to OOP and less ambiguous
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to call a public sub function from either a userform or another sub
    By daustin5 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2016, 04:16 PM
  2. How to call N of Multiple of the same Named Public Subroutines (N of Many Workbooks)
    By Kalithro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2016, 07:56 AM
  3. how to call public function () in sub pro()
    By pvprasad_26 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2015, 02:43 AM
  4. [SOLVED] Call a Public Function in another function
    By kamelkid2 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-16-2014, 09:00 AM
  5. Problem with setting a public worksheet
    By sylvain133 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2013, 10:49 AM
  6. Public Worksheet Declaration
    By wilro85 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2009, 08:08 PM
  7. Syntax to call Public Macro
    By TheNewGuy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-08-2009, 12:58 PM

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