ich brauche dringend Hilfe bei folgendem Fall: Wie kann ich jede 4. Zeile eines Tabellenblatts in ein Array einlesen und anschließend das komplette array in ein anderes Tabellenblatt einfügen?
Vielen Dank im Voraus!
Sub teste()
Dim X As Variant, Y As Variant, L As Long, M As Long
X = Tabelle1.Range("A1").CurrentRegion.Value
ReDim Y(1 To UBound(X, 2), 1 To UBound(X, 1))
For L = 4 To UBound(X, 1) Step 4
For M = 1 To UBound(X, 2)
Y(M, (L / 4)) = X(L, M)
Next
Next
L = (L - 4) / 4
ReDim Preserve Y(1 To UBound(Y, 1), 1 To L)
Tabelle2.Cells(2, 1).Resize(UBound(Y, 2), UBound(Y, 1)) = WorksheetFunction.Transpose(Y)
Erase Y
End Sub
Sub teste2()
Dim X As Variant, Y As Variant, L As Long, M As Long, N As Long
X = Tabelle1.Range("A1").CurrentRegion.Value
ReDim Y(1 To UBound(X, 2), 1 To UBound(X, 1))
For L = 2 To UBound(X, 1) Step 4
N = N + 1
For M = 1 To UBound(X, 2)
Y(M, N) = X(L, M)
Next
Next
ReDim Preserve Y(1 To UBound(Y, 1), 1 To N)
Tabelle2.Cells(2, 1).Resize(UBound(Y, 2), UBound(Y, 1)) = WorksheetFunction.Transpose(Y)
Erase Y
End Sub