Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
BRC BRC is offline
external usenet poster
 
Posts: 10
Default running a macro on another worksheet

I have a workbook with several sheets. when i enter values into
certain cells on WS1 i want each sheet to run a macro to analyze those
values. For instance; in WS2 I have a macro that fills in a table on
ws2. In WS3 there is a macro that fills in a table on WS3 etc. I am not
sure if I should be trying to run the macros on their specific sheets
or put them in a module and somehow code the output to the respective
sheets. I have a command button on sheet to start the process. Any
suggestions would be appreciated. thanks, BRC

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default running a macro on another worksheet

It depends on your style how you structure your code and where the code is
used.

But you need to initiate the code either with a butoon or using one of the
change events (assuming check cell A1 on sheet1). This code goes into the
code for the worksheet:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Intersect(Me.Range("A1"), Target) Is Nothing) Then
'call your rountines
CELL1
End If
End Sub

' this can go into the code for the sheet1 or a new module
Private Sub CELL1()
Worksheets("Sheet2").Range("A1") = Time
End Sub

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"BRC" wrote:

I have a workbook with several sheets. when i enter values into
certain cells on WS1 i want each sheet to run a macro to analyze those
values. For instance; in WS2 I have a macro that fills in a table on
ws2. In WS3 there is a macro that fills in a table on WS3 etc. I am not
sure if I should be trying to run the macros on their specific sheets
or put them in a module and somehow code the output to the respective
sheets. I have a command button on sheet to start the process. Any
suggestions would be appreciated. thanks, BRC


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default running a macro on another worksheet

BRC
I would use a Worksheet_Change macro in WS1. The code in that macro
would determine if the change that occurred was in any of the "certain"
cells. If that is the case, that macro would then call a regular (not
event) macro that itself calls each of the other macros. Each of the other
macros would contain code to direct the actions to the desired sheet.
Please post back if you need more. HTH Otto
"BRC" wrote in message
ups.com...
I have a workbook with several sheets. when i enter values into
certain cells on WS1 i want each sheet to run a macro to analyze those
values. For instance; in WS2 I have a macro that fills in a table on
ws2. In WS3 there is a macro that fills in a table on WS3 etc. I am not
sure if I should be trying to run the macros on their specific sheets
or put them in a module and somehow code the output to the respective
sheets. I have a command button on sheet to start the process. Any
suggestions would be appreciated. thanks, BRC



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
macro enabled excel worksheet running very slow. Bill R Excel Discussion (Misc queries) 1 May 21st 09 09:57 PM
Macro running against hidden worksheet George Excel Discussion (Misc queries) 1 July 23rd 07 09:42 PM
How to activate a worksheet when a macro is running in the sheet m BFSWE Excel Programming 6 October 19th 06 02:19 PM
Editing a worksheet while running a macro Dan Perkins Excel Programming 3 October 11th 06 04:04 AM
Running macro on the perticular worksheet only vanessa h[_3_] Excel Programming 3 January 25th 06 10:41 AM


All times are GMT +1. The time now is 10:10 PM.

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"