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