View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
stratis stratis is offline
external usenet poster
 
Posts: 32
Default Compare a Worksheet to another Worksheet.


Otto, I got usae from your macro
However the 2 files i am comparing have their data arranged to different
collums
For example File A its colum 1 starts at row 2 whereas this colum infile B
is moved to colum 5 and starts at row 3. Is there a way since this relation
is always the same to define those relations as an offset and continue to use
your macro?

Ο χρήστης "Otto Moehrbach" *γγραψε:

Susan
This little macro will do that. I assumed your two sheets were named
"One" and "Two", and the range to be checked is A1:P100. Change all that as
needed.
As written, this macro will compare each cell in sheet "One" with the same
cell in sheet "Two", and will color the cell in sheet "One" red if the
values are not the same. Post back if you need more. HTH Otto
Sub CompareSheets()
Dim Rng1 As Range
Dim i As Range
Sheets("One").Select
Set Rng1 = Range("A1:P100")
With Sheets("Two")
For Each i In Rng1
If i.Value < .Range(i.Address).Value Then _
i.Interior.ColorIndex = 3
Next i
End With
End Sub
"Susan@seaboard" wrote in message
...
Hello, any help would be appreciated.

I have two spread sheets, the data elements should be the same. So we
must
verify this. Is there a way to compare a spread sheet to another spread
sheet to see the differences?

-- Thanks Susan