+ Reply to Thread
Results 1 to 5 of 5

hw we call a private macro in other sheet from module1

  1. #1
    Forum Contributor
    Join Date
    01-29-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    434

    hw we call a private macro in other sheet from module1

    Hello

    We r working in a workbook with few macros which is in PRIVATE sub ….all macros in Module1

    We are using a VBA in Sheet1 where we want to call A macro for example Macro1
    But show a error when we remove PRIVATE macro run..

    But we don’t want to remove PRIVATE so pls guide me how can I call a private macro in other sheet from module1

    Thanks in advance
    <Santosh>

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: hw we call a private macro in other sheet from module1

    Sounds like your goal may be to hide macros from the macros dialog. If so, see: http://www.mrexcel.com/archive/VBA/12141.html

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: hw we call a private macro in other sheet from module1

    You may use Application.Run but why must the routine be private if you will need to call it from other modules?
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  4. #4
    Forum Contributor
    Join Date
    01-29-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    434

    Re: hw we call a private macro in other sheet from module1

    hello Kenneth hobson
    We got help from ur provided link.. & my problem solve but in that module which was public macro that was not working

    actually we make a custom menu in excel with public macro where we hide some commonbar hide & when we goes other workbook then unhide those commondbar which was hide in previous worksheet... so this show a error..

    is there any option where both work private & public..

  5. #5
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: hw we call a private macro in other sheet from module1

    The link explained how to do it. Public makes it available to the end user via the macros dialog. I doubt you would want that.

    As suggested by Izondol, Application.Run might be sufficient for your needs.
    e.g.
    In Sheet1:
    Please Login or Register  to view this content.
    In a Module or other:
    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] Call Private Sub Routine From Main Macro
    By timbo1957 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2013, 04:50 AM
  2. Cannot Call UDF written in Module1
    By slash_gnr3k in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2012, 05:53 AM
  3. Using Call Module1.Offset = debug error
    By garretonufer in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-29-2009, 05:12 PM
  4. call module sub from sheet private sub
    By tango in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2009, 03:10 AM
  5. how to call a Private Sub ?
    By dpenny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2007, 01:15 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