Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Sub () that does NOT appear in Macro selection

Is there a way to have a Sub () not appear in the macro selection (alt f9) ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Sub () that does NOT appear in Macro selection

Private Sub yourMacroNmae()

"J@Y" wrote:

Is there a way to have a Sub () not appear in the macro selection (alt f9) ?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Sub () that does NOT appear in Macro selection

On Jul 13, 11:46 am, Mike wrote:
Private Sub yourMacroNmae()

"J@Y" wrote:
Is there a way to have a Sub () not appear in the macro selection (alt f9) ?



If a sub has a parameter then it won't appear.

private sub yourMacroName(dummy as object)

Just pass in a 0

Peter

  #4   Report Post  
Posted to microsoft.public.excel.programming
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Sub () that does NOT appear in Macro selection

I just noticed that Private subs from other modules can't be called. Is there
a way around this?

" wrote:

On Jul 13, 11:46 am, Mike wrote:
Private Sub yourMacroNmae()

"J@Y" wrote:
Is there a way to have a Sub () not appear in the macro selection (alt f9) ?



If a sub has a parameter then it won't appear.

private sub yourMacroName(dummy as object)

Just pass in a 0

Peter


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Sub () that does NOT appear in Macro selection

On Jul 13, 12:16 pm, J@Y wrote:
I just noticed that Private subs from other modules can't be called. Is there
a way around this?

" wrote:
On Jul 13, 11:46 am, Mike wrote:
Private Sub yourMacroNmae()


"J@Y" wrote:
Is there a way to have a Sub () not appear in the macro selection (alt f9) ?


If a sub has a parameter then it won't appear.


private sub yourMacroName(dummy as object)


Just pass in a 0


Peter

Don't put the word private on it.

Peter



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Sub () that does NOT appear in Macro selection

Hi J@y, private subs are normally used for ThisWorkbook, Worksheet and
Control Event code such as Workbook_Open, Wordsheet_Activate and
UserForm_Click. They are not intended to work except for that specific
environment. If the designer wants code to be public and able to be called
from anywhere in the project, then the code needs to be written in the
general modules which are named Module 1, 2, etc. and do not precede the word
sub with the word private.

"J@Y" wrote:

I just noticed that Private subs from other modules can't be called. Is there
a way around this?

" wrote:

On Jul 13, 11:46 am, Mike wrote:
Private Sub yourMacroNmae()

"J@Y" wrote:
Is there a way to have a Sub () not appear in the macro selection (alt f9) ?



If a sub has a parameter then it won't appear.

private sub yourMacroName(dummy as object)

Just pass in a 0

Peter


  #7   Report Post  
Posted to microsoft.public.excel.programming
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Sub () that does NOT appear in Macro selection

Quick and simple. Thanks!

"Mike" wrote:

Private Sub yourMacroNmae()

"J@Y" wrote:

Is there a way to have a Sub () not appear in the macro selection (alt f9) ?

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
How can run a macro ( call a macro) on selection of any filtercriteria? [email protected] Excel Worksheet Functions 7 February 20th 09 12:34 AM
SELECTION macro Gene Augustin Excel Discussion (Misc queries) 1 February 5th 09 03:51 PM
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Macro for row selection JAC1967 Excel Discussion (Misc queries) 1 August 28th 07 06:20 PM
Macro to print selection [email protected] Excel Programming 7 January 31st 07 05:40 PM


All times are GMT +1. The time now is 12:33 AM.

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

About Us

"It's about Microsoft Excel"