Sub
MovingAverage2()
Dim
iRowTab2
As
Integer
, iRowTab4
As
Integer
Dim
datATab2
As
Variant
, datBTab2
As
Variant
Dim
datATab4
As
Variant
, datBTab4
As
Variant
Dim
xTab2
As
Variant
, xTab4
As
Variant
Dim
n
As
Integer
With
Worksheets(
"Tabelle2"
)
iRowTab2 = .Cells(Rows.Count, 1).
End
(xlUp).Row
datATab2 = .Range(
"A2:A"
& iRowTab2).Value
datBTab2 = .Range(
"B2:B"
& iRowTab2).Value
End
With
ReDim
xTab2(1
To
UBound(datATab2), 1)
For
n = 1
To
UBound(datATab2)
xTab2(n, 1) = datATab2(n, 1) & datBTab2(n, 1)
Next
n
With
Worksheets(
"Tabelle4"
)
iRowTab4 = .Cells(Rows.Count, 1).
End
(xlUp).Row
datATab4 = .Range(
"A2:A"
& iRowTab4).Value
datBTab4 = .Range(
"B2:B"
& iRowTab4).Value
End
With
ReDim
xTab4(1
To
UBound(datATab4), 1)
For
n = 1
To
UBound(datATab4)
xTab4(n, 1) = datATab4(n, 1) & datBTab4(n, 1)
Next
n
For
n = 1
To
UBound(datATab2)
If
datATab2(n, 1) <> datATab4(n, 1)
Then
MsgBox
"Werte aus Zeile "
& (n + 1) &
" sind nicht ident."
End
If
Next
n
For
n = 1
To
UBound(xTab2)
If
xTab2(n, 1) <> xTab4(n, 1)
Then
MsgBox
"Werte aus Zeile "
& (n + 1) &
" sind nicht ident."
End
If
Next
n
End
Sub