ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   comparing sheets (https://www.excelbanter.com/excel-programming/274204-comparing-sheets.html)

Lorenzo

comparing sheets
 
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

Will Francis

comparing sheets
 
Thanks Tom, that worked great!

Regards
Will
-----Original Message-----
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
.


Tom Ogilvy

comparing sheets
 
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.

--
Regards,
Tom Ogilvy


"Lorenzo" wrote in message
om...
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





All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com