comparing sheets

  • Thread starter Thread starter Lorenzo
  • Start date Start date
L

Lorenzo

I know this has probably been discussed milliions of times before, but
I am still quite confused. I need to compare two sheets for
differences, without highlighting them or anything. just comparing.
Basically, I have a sheet that updates from an internet service that's
always running, and I needed a small macro that will check if the
service has frozen.
The way I see it, the best thing is to have a macro that compares the
updating sheet to a hidden sheet that will be a copy of it, so the
macro structure would be something like

ontime run every 2 minutes
compare sheet1 and hiddensheet
if sheet1 = hiddensheet then msgbox "verify internet connection"
else copy sheet1 nad paste on hiddensheet

I hope I have made myself clear, and that somebody out there can help
me, please...
Thank you for any help you may be able to give

Lorenzo Lucchini Gilera
 
What will you be comparing - Numbers.

The basic approach would be to use the Ontime method

See Chip Pearson's page on this

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

If you are comparing numbers

in the procedure triggered by ontime you can

Activesheet.UsedRange.copy
With worksheets("HiddenSheet")
.Range("A1").PasteSpecial paste:=xlPasteValues, _
Operation:=xlPasteSpecialOperationSubtract
res = Application.Sum(.UsedRange)
End With
if res = 0 then
' sheets are identical
Else
' sheets are differenct
End if

Of course if you would consistently have offsetting/complimentatry changes
such a -4 and +4 in different cells then this would be problematic, but
hopefully that would not be the case.
 
Back
Top