Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't activate an add-ins Ivan Setting up and Configuration of Excel 0 June 5th 08 09:33 AM
.Activate vs. .Select in VBA Dave F Excel Discussion (Misc queries) 1 January 24th 07 03:41 PM
When to Activate? Antonio Excel Discussion (Misc queries) 5 June 8th 06 12:26 AM
Activate all sheets George Gee New Users to Excel 10 December 3rd 05 10:00 PM
De-activate a chart daniel chen Excel Discussion (Misc queries) 6 April 24th 05 05:01 AM


All times are GMT +1. The time now is 11:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"