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: 81
Default worksheet_calculate event changes worksheets, but shouldn't

Hi,

The code below is in the Sheet1 (Budget) Module: The user is entering
data into the "Budget" worksheet. When this fires, it should hide some
rows on the Categories worksheet. It does work ok, however, everytime a
user enters a new figure on the Budget worksheet, it fires and
momentarily flashes over to the Categories worksheet. It is quite
distractive, especially when one has hundreds of figures to enter.

I set a trap to stop it on the top line of this code - the Private Sub
Worksheet_Calculate() line.

Then, when I enter a new number on the Budget page, it fires, and stops
on this top line of code. At that point, before any of the code below
has run, the screen has already flashed over to the Categories page and
waits there until I hit F8. Then when I hit F8 twice, after it executes
the second line (screen updating = false), then it switches back to the
Budget worksheet where it should be and remains there.

To be more precise, when it flashes to the Categories worksheet, what
actually shows on the screen is:
Top half of screen is the Budget page
Bottom half of screen is the Categories page.
It's almost like when a partial refresh happens sometimes. The Budget
tab is still active, not the Categories tab.

I'd surely appreciate any ideas you may have to stop this flashing
over. Thanks, Harold

Private Sub Worksheet_Calculate()
'this hides the message rows on Categories page if Budget Total is
greater than 1
Application.ScreenUpdating = False
Sheets("Categories").Unprotect Password:="xxx"
Application.EnableEvents = False
If Sheets("Budget").Range("J111").Value 1 Then
Sheets("Categories").Rows("32:33").EntireRow.Hidde n = False
Else
If Sheets("Budget").Range("E30").Value = 0 Then
Sheets("Categories").Rows("32:33").EntireRow.Hidde n = True
End If
End If
Application.EnableEvents = True
Application.ScreenUpdating = False
Sheets("Categories").Protect Password:="xxx"
End Sub
 
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 event and input data Horatiu Excel Programming 3 November 26th 06 12:51 PM
Worksheet_Calculate event problem Otto Moehrbach[_6_] Excel Programming 2 October 28th 04 10:41 PM
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 01:58 AM.

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"