View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Martin Fishlock Martin Fishlock is offline
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