LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Worksheet_Calculate event problem

Excel 2002, WinXP
I have a sheet with many formulas. That sheet will calculate whenever the
file is opened. That will trigger the Worksheet_Calculate macro that I
have, and that is the beginning of my problem.
The macro consists of one line:
Private Sub Worksheet_Calculate()
If ActiveSheet.Name < Range("AA1").Value Then Call MyMacro
End Sub

My problem is that MyMacro is being called at times when I'm not expecting
it. I believe that what is happening is that specific sheet is
automatically calculating, like at opening of the file, when that sheet is
not the ActiveSheet. That causes the call to MyMacro.

I need to copy this code on to many other sheet modules, so I don't want to
use the name of the sheet.
Question. How can I code the above event macro so that the code will look
at only the name of the sheet and the contents of cell AA1 of the sheet in
which the code is written?
For your info, I am trying to prevent anyone from changing the sheet name of
any of these sheets. Right now this code is in only one of those sheets.
Thanks for your help. Otto


 
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
worksheet_calculate enyaw Excel Discussion (Misc queries) 2 January 26th 07 01:16 PM
worksheet_calculate enyaw Excel Discussion (Misc queries) 0 January 26th 07 08:14 AM
A procedure should run when one cell switch between false/true - but not with worksheet_calculate or change event... Gunnar Johansson Excel Programming 3 October 19th 04 05:24 PM
dynamically changing chart y axis using spin buttons and worksheet_calculate event jimnwilson Excel Programming 2 July 10th 04 04:24 AM
worksheet_calculate **help** tommyboy Excel Programming 2 June 29th 04 08:33 AM


All times are GMT +1. The time now is 09:33 PM.

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

About Us

"It's about Microsoft Excel"