View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Run Macro when click on different tab in Excel

Right-click on the Pivot Tab.

Select "View Code"

Copy/paste this code to the sheet module that opens.

Private Sub Worksheet_Activate()
findandreplace
FormatDate
End Sub

Leave the two macros where they are in the general modules.


Gord Dibben MS Excel MVP


On Wed, 22 Jul 2009 10:07:01 -0700, Supe
wrote:

There are 5 Modules listed. I have two macros I want to activate:

findandreplace
FormatDate

Do I need to list each macro in a separate code? Which module would I put
it in? My findandreplace macro is in Module 3 and my FormatDate macro is in
Module 5.


"Gord Dibben" wrote:

Copy/paste this to the pivot tab module.

Private Sub Worksheet_Activate()
macroname
End Sub


Gord Dibben MS Excel MVP

On Mon, 20 Jul 2009 14:36:02 -0700, Supe
wrote:

Is there a way to set up a macro to run when you click on a different tab in
the Excel sheet? I have a data tab where I pull my data tab that I have set
up a macro to format some of the data in that pull. Would like that macro to
run when I click on the pivot tab. Is this possible?