Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro enabled excel worksheet running very slow. | Excel Discussion (Misc queries) | |||
Macro running against hidden worksheet | Excel Discussion (Misc queries) | |||
How to activate a worksheet when a macro is running in the sheet m | Excel Programming | |||
Editing a worksheet while running a macro | Excel Programming | |||
Running macro on the perticular worksheet only | Excel Programming |