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: 1
Default run until mouse moves?

i've a fun question

i've noticed that (at least in excel 97) if you use th
workbook_sheetchange event, and you use it to update the value of tw
different cells, it will throw itself into a loop as it bounces fro
one update to the other.

i got the bright idea to use this to update a cell containing th
current time, to get an actively updating clock without the API call.
but i wanted it to "turn on" only when a certain cell was activated...

this required a second event, tied to the SheetSelectionChange event
which simply called the first event

it works great... except, i thought i would be able to select anothe
range while the macro was running, and it would end the loop. no dice
the only way to quit is to hit ESC, and then "End." which i
inelegant. since i can't change the selection, i'd like to have i
notice the movement of the mouse, and terminate on that. is tha
possible?

'begin code
'this code is in a 'workbook' module

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target A
Excel.Range)
If ActiveCell.Address = "$H$13" Then

Range("H2").Value = " "
Range("C4").Value = Time

End If
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVa
Target As Excel.Range)

Call Workbook_SheetChange(Sh, Target)

End Sub

'end cod

--
Message posted from http://www.ExcelForum.com

 
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
Text box moves around Nathan Charts and Charting in Excel 1 December 28th 06 12:41 AM
my mouse moves diagonally when i scroll on mouse? BKMISHRA Excel Worksheet Functions 0 June 29th 05 11:43 AM
Tab key moves DCZ Excel Discussion (Misc queries) 1 June 28th 05 06:53 PM
Excel now moves Left & Right when I scroll the mouse not Up & Down Randyz77 Excel Discussion (Misc queries) 0 May 2nd 05 04:32 PM
moving mouse highlights cells without touching left mouse button bremboy Excel Discussion (Misc queries) 2 January 27th 05 06:19 PM


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