Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Activate event
I would like a macro to run ONLY ONCE when SheetX is
activated. I would then like cell A1 on SheetX to be selected. How do I get this to work so that the macro does not keep running again and again when cell A1 on SheetX is selected? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Activate event
Private Sub Worksheet_Activate()
FdrExtract Sheets("BOM & Price").Select Range("A1").Select End Sub The problem occurs when sheet BOM & Price is selected...the FdrExtract macro runs again and I end up in an infinite loop. -----Original Message----- Post your macro here. "Lynn" wrote in message ... I would like a macro to run ONLY ONCE when SheetX is activated. I would then like cell A1 on SheetX to be selected. How do I get this to work so that the macro does not keep running again and again when cell A1 on SheetX is selected? . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Activate event
Thanks Tom!
-----Original Message----- In the sheet module at the top: Dim bBlockcode as Boolean Private Sub Worksheet_Activate() if bBlockCode then exit sub Range("A1").Select bBlockCode = True End If End Sub -- Regards, Tom Ogilvy Lynn wrote in message ... I would like a macro to run ONLY ONCE when SheetX is activated. I would then like cell A1 on SheetX to be selected. How do I get this to work so that the macro does not keep running again and again when cell A1 on SheetX is selected? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't activate an add-ins | Setting up and Configuration of Excel | |||
.Activate vs. .Select in VBA | Excel Discussion (Misc queries) | |||
When to Activate? | Excel Discussion (Misc queries) | |||
Activate all sheets | New Users to Excel | |||
De-activate a chart | Excel Discussion (Misc queries) |