Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to be able to run a macro when I open worksheet only if i
opened worksheet from a particual sheet. if i open sheet 1 and was on sheet 2 i want macro in sheet 1 "on open" to run if i open sheet 1 and was on sheet 3 i want macrro in sheet 1 "on open" no to run |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
something like this in the ThisWorkbook code module:
Dim strPreviousSheet As String Private Sub Workbook_SheetActivate(ByVal Sh As Object) If Sh.Name = "Sheet1" And strPreviousSheet = "Sheet2" Then 'Call a sub defined in sheet1 Sheets(Sh.Name).test End If strPreviousSheet = Sh.Name End Sub -- Hope that helps. Vergel Adriano "Sliman" wrote: I need to be able to run a macro when I open worksheet only if i opened worksheet from a particual sheet. if i open sheet 1 and was on sheet 2 i want macro in sheet 1 "on open" to run if i open sheet 1 and was on sheet 3 i want macrro in sheet 1 "on open" no to run |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
unsure how to set up worksheet to capture data | Excel Discussion (Misc queries) | |||
Excel screen capture to capture cells and row and column headings | Excel Discussion (Misc queries) | |||
Capture a worksheet in VBA | Excel Programming | |||
Macro to capture worksheet names | Excel Worksheet Functions | |||
Capture mouses X &Y position on a worksheet | Excel Programming |