tags:

views:

17

answers:

2

Hi ,

I need to find a way to identify if 2 Excel documents are basically based on the same nomenclature.

The first document need to load data from the second one. And I want to make sure that the first document is correctly trying to load relevant data.

Is there a clever way in order to do so ?

My very primal thinking at the moment would be to look in the excel document for specific string that would need to be the same. Or setting a special string property in the excel properties document, and check whether this is correct.

Any ideas ?

Regards,

A: 

Here is what I was looking for :

' Loop through each cell in first Range and compare it with
' each cell in second one.
Function isIdentic(Range As Range, RangeB As Range)

isIdentic = True
Dim counter As Long
counter = 1

For Each Value In Range
toCompare = RangeB.Cells(counter)

    If Value <> toCompare Then
'print the values which are different
    MsgBox Value & " : " & toCompare
    isIdentic = False
    Exit For
    End If

counter = counter + 1
Next Value

End Function

If any advice please share !

Regards,

Farid