Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Check changes on a sheet

In your ontime event, save a copy of the sheet in an array. When the event
runs again, get a copy in an array again - then compare the arrays - repeat
until cooked.

here is some untested pseudo code that might give you some ideas

Public newTime as Double

Sub OnTimeEventMacro()
Static varrold as variant
newtime = now + timevalue("00:02")
if isempty(varrold) then
varrold = ActiveSheet.UsedRange.Value
Application.OnTime newTime,"OnTimeEventMacro"
exit sub
End if
varrnew = Activsheet.UsedRange
bChanged = False
for i = lbound(varrnew,1) to ubound(varrnew,1)
for j = lbound(varrnew,2) to ubound(varrnew,1)
if varrnew(i,j) < varrOld(i,j) then
bchanged = True
exit for
end if
Next
if bChange = True then
exit for
end if
Next
if bChanged = True then
' schedule new check
varrold = varnew
Application.OnTime newTime,"OnTimeEventMacro"
End If
End Sub


--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
Look at Chip Pearson's example of using Application.OnTime

http://www.cpearson.com/excel/ontime.htm


Regards,
Tom Ogilvy

"Lorenzo" wrote in message
m...
I hope somebody can help me out on this one, because I am seriously
stuck and quite desperate too.
I have a sheet full of formulas that update the sheet in real time
with info from bloomberg. Unfortunately, every now and then the
bloomberg service crashes and the screen stops updating, but nobody
realizes it. So the question is:
Is there a way of writing a macro that every 2 minutes will see if
there have been any changes (in the last 2 minutes) on the sheet, and
if there aren't any have an alert pop-up message appear? Possibly with
an alert sound too (default windows or whatever, I don't care)?
Thanks for any help you guys out there can give me.
Lorenzo





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
Check Activesheet for chart sheet or work sheet NSK Charts and Charting in Excel 1 July 17th 07 09:00 PM
How do I use 1 excel sheet to check another? Pawan Excel Discussion (Misc queries) 3 August 14th 06 08:33 PM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
how to use sumif function to check date in 1 sheet is < 2 sheet Bharat Saboo Excel Worksheet Functions 3 December 30th 05 07:10 AM
check if sheet exists Ross[_6_] Excel Programming 3 July 25th 03 06:46 PM


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