Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default private macro and shortcut key

Is it possible to have a keyboard shortcut for a macro that is designated
Private? I have created a macro and given it a keyboard shortcut. The macro
works perfectly, until I made it "Private Sub Macro." Any ideas why this
doesn't work?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default private macro and shortcut key

Since it is private to your project/workbook/module, then the application
can not see the procedure.

--
Regards,
Tom Ogilvy


"redb" wrote in message
...
Is it possible to have a keyboard shortcut for a macro that is designated
Private? I have created a macro and given it a keyboard shortcut. The

macro
works perfectly, until I made it "Private Sub Macro." Any ideas why this
doesn't work?

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default private macro and shortcut key


If you want, you can call it from a Public Sub, and have the Public Sub
assigned to a keyboard shortcut:

Sub myPublicRoutine
Call myPrivateRoutine
End Sub

Private Sub myPrivateRoutine
msgbox "Called from public routine which was initiated from a keyboard
shortcut"
end sub

Here's some verbage on Public/Private

Public Optional. Indicates that the Sub procedure is accessible to all other
procedures in all modules. If used in a module that contains an Option
Private statement, the procedure is not available outside the project.

Private Optional. Indicates that the Sub procedure is accessible only to
other procedures in the module where it is declared.


"Tom Ogilvy" wrote:

Since it is private to your project/workbook/module, then the application
can not see the procedure.

--
Regards,
Tom Ogilvy


"redb" wrote in message
...
Is it possible to have a keyboard shortcut for a macro that is designated
Private? I have created a macro and given it a keyboard shortcut. The

macro
works perfectly, until I made it "Private Sub Macro." Any ideas why this
doesn't work?

Thanks!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
re : Possible to run private sub macros by writing another private ddiicc Excel Programming 5 August 26th 05 04:49 AM
Private Sub Running Other Private Sub Inadvertently Ross Culver Excel Programming 2 February 10th 05 07:17 PM
Possible to assign macro defined as private to a form control. Bing Excel Programming 1 December 24th 04 06:08 AM
Macro Shortcut Alex[_13_] Excel Programming 3 June 1st 04 12:55 PM
Add code to Private Sub ComboBox1_Change() with a macro from a different workbook help_wanted[_2_] Excel Programming 4 April 2nd 04 06:47 PM


All times are GMT +1. The time now is 01:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"