Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Automatic Macros
How can I automatically initiate a macro when I switch tabs within a worksheet
|
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Automatic Macros
Right-click the Sheetname and select 'View Code'...
In the VB Editor put your code between Private Sub Worksheet_Activate() End Sub this will be executed everytime the sheet is activated "David Fredrickson" wrote: How can I automatically initiate a macro when I switch tabs within a worksheet |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Automatic Macros
Private Sub Workbook_SheetActivate(ByVal Sh As Object) Select Case Sh.Name Case "Sheet1": 'do something Case "Sheet2": 'do something else End Select End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- __________________________________ HTH Bob "David Fredrickson" <David wrote in message ... How can I automatically initiate a macro when I switch tabs within a worksheet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 macros - how to merge 5 macros together into one | Excel Discussion (Misc queries) | |||
Macros warning always shows up, even if all macros removed | Excel Discussion (Misc queries) | |||
How to enable macros and automatic calculation on Excel Viewer? | Excel Worksheet Functions | |||
Macros - copying macros from one computer to another | Excel Discussion (Misc queries) | |||
Training: More on how to use macros in Excel: Recording Macros | Excel Worksheet Functions |