Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default cells with formula fire worksheet_change when navigating thru them

hi, i have cells that contain diff. formula and the first time i enter any
one of them then leave it (eg. use arrow key to scroll across columns in a
given row) the worksheet change event is fired. is this a bug because
nothing has changed in the cell (perhaps some recalculate event has fired?).

the reason the above noted behaviour is a problem is because in my
worksheet_change event i execute an
Application.Undo
and this line of code throws an error because nothing there is nothing to
undo because nothing has actually changed. i don't know how to test for
whether there is anything to undo. i found something about the undo list but
can't figure out the syntax to access this "object".
any help would be wonderful...
cheers, pwrob

--
xl help seeker
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default cells with formula fire worksheet_change when navigating thru them

Without seeing the worksheet event code, your questions cannot be answered
with accuracy. However, it is doubtful that there is a bug in the system
software. The problem is most likely in the structure of the event code.
This can oftem be remedied by using an If ... Then statement to set a
criteria that must exist before the event code will fire.

As and example only:

Private Sub Worksheet_Change(ByVal Target As Range)
If Taget = Range("C5" ) Then
'Do something
End If
End Sub

If the target range was C5 then the code would execute the Do Something
line, otherwise it does nothing.



"pwrob" wrote in message
...
hi, i have cells that contain diff. formula and the first time i enter
any
one of them then leave it (eg. use arrow key to scroll across columns in a
given row) the worksheet change event is fired. is this a bug because
nothing has changed in the cell (perhaps some recalculate event has
fired?).

the reason the above noted behaviour is a problem is because in my
worksheet_change event i execute an
Application.Undo
and this line of code throws an error because nothing there is nothing to
undo because nothing has actually changed. i don't know how to test for
whether there is anything to undo. i found something about the undo list
but
can't figure out the syntax to access this "object".
any help would be wonderful...
cheers, pwrob

--
xl help seeker



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
Fire Worksheet_change event from module avi Excel Programming 4 January 17th 10 11:41 AM
Worksheet_Change does it fire for a cell changed via foruma? [email protected][_2_] Excel Programming 3 April 10th 08 05:16 PM
Navigating between cells [email protected] Excel Discussion (Misc queries) 3 June 30th 06 02:26 PM
Navigating through Cells DanielPolak Excel Discussion (Misc queries) 2 February 13th 06 02:02 PM
Worksheet_Change event won't fire to execute Macro??? jpdill5 Excel Programming 2 February 13th 04 02:34 PM


All times are GMT +1. The time now is 05:23 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"