Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Calling a Sub from Another Sheet

I have multiple sheets all running code. However, there are times when I
would rather call a sub from another worksheet instead of duplicating the
code.

I used Call SubName to call it from the active sheet. What is the syntax for
calling it from say, Sheet1(Surface) instead of the current Sheet13(Intro)

Also, is there any way to organize the "Sheet1", "Sheet2", etc? Under
Microsoft Excel Objects, the actual order of the sheets is so out of order.
The "SheetX" name seems to be given when the sheets are created. Can this be
changed to better sort them?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Calling a Sub from Another Sheet

Hi Baconcow,

Try moving these subs to a standard module:

In the VBE,

Menu | Insert | Module.

A worksheet modul should normally only be
used for worksheet event code.



---
Regards.
Norman
"baconcow" wrote in message
...
I have multiple sheets all running code. However, there are times when I
would rather call a sub from another worksheet instead of duplicating the
code.

I used Call SubName to call it from the active sheet. What is the syntax
for
calling it from say, Sheet1(Surface) instead of the current Sheet13(Intro)

Also, is there any way to organize the "Sheet1", "Sheet2", etc? Under
Microsoft Excel Objects, the actual order of the sheets is so out of
order.
The "SheetX" name seems to be given when the sheets are created. Can this
be
changed to better sort them?

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Calling a Sub from Another Sheet

How do I call a sub that is on the standard module from the active worksheet?

"Norman Jones" wrote:

Hi Baconcow,

Try moving these subs to a standard module:

In the VBE,

Menu | Insert | Module.

A worksheet modul should normally only be
used for worksheet event code.



---
Regards.
Norman
"baconcow" wrote in message
...
I have multiple sheets all running code. However, there are times when I
would rather call a sub from another worksheet instead of duplicating the
code.

I used Call SubName to call it from the active sheet. What is the syntax
for
calling it from say, Sheet1(Surface) instead of the current Sheet13(Intro)

Also, is there any way to organize the "Sheet1", "Sheet2", etc? Under
Microsoft Excel Objects, the actual order of the sheets is so out of
order.
The "SheetX" name seems to be given when the sheets are created. Can this
be
changed to better sort them?

Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Calling a Sub from Another Sheet

Hi Baconcow,

============
How do I call a sub that is on the standard module from the active
worksheet?
============

If you refer to calling a sub in a standard module
from worksheet event code, try:

Call myMacro

In fact, the same would apply to non event code
but, as indicated previously, a worksheet module
should normally only house worksheet event code



---
Regards.
Norman


"baconcow" wrote in message
...
How do I call a sub that is on the standard module from the active
worksheet?

"Norman Jones" wrote:

Hi Baconcow,

Try moving these subs to a standard module:

In the VBE,

Menu | Insert | Module.

A worksheet modul should normally only be
used for worksheet event code.



---
Regards.
Norman


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
Calling name of Sheet as a Variable? thekeytothedoor Excel Worksheet Functions 1 January 1st 10 08:48 AM
Calling an inactive sheet... RJH Excel Programming 1 July 17th 06 04:23 AM
Calling command button from another sheet Ian[_17_] Excel Programming 4 April 13th 06 07:41 PM
Calling a Sheet [email protected] Excel Programming 1 September 27th 05 03:44 PM
Calling Text Boxes from a sheet Jordan Excel Programming 2 February 21st 05 02:27 PM


All times are GMT +1. The time now is 10:03 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"