Compare a Worksheet to another Worksheet.

G

Guest

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
 
O

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
 
J

Jim Cone

If you don't want to do the programming... the commercial Excel add-in
"XL Companion" (from yours truly) can make several different types of
worksheet comparisons. See...
http://www.realezsites.com/bus/primitivesoftware
--
Jim Cone
San Francisco, USA
(Excel Add-ins / Excel Programming)


"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
 
G

Guest

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" έγγÏαψε:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Compare two sheets and combine into one 2
Replacement for multiple spreadsheets 3
Excel extended desktop options 1
Vlookup Formula Help 11
SOS 7
Summing Like items 2
sorting coloumns 0
Show Only Fields Needed 0

Top