Option Explicit
Function ABcompare(Atab As String, _
BTab As String, Acols As String, Bcols As String, _
Arow As Long, Brow As Long) As Boolean
Dim oAPP As Application
Dim Arange As Range, Brange As Range
Dim Astr As String, Bstr As String
Set oAPP = Application
Set Arange = Sheets(Atab).Columns(Acols)
Set Brange = Sheets(BTab).Columns(Bcols)
Astr = Join(oAPP.Transpose(oAPP.Transpose(Arange.Rows(Arow).Value)), Chr(0))
Bstr = Join(oAPP.Transpose(oAPP.Transpose(Brange.Rows(Brow).Value)), Chr(0))
If Astr = Bstr Then ABcompare = True
Set oAPP = Nothing
End Function
Sub test()
'vergleicht Zeile 3 mit Zeile 3
'der Rest ist wohl selbstplaudernd
Call MsgBox("Vergleich = " & ABcompare("Tabelle A", "Tabelle B", "A:D", "A:D", 3, 3), vbInformation)
End Sub
|