Public
Sub
Spalten_Automatisiert_umstellen(
ByVal
wsTab
As
Worksheet,
ParamArray
Data()
As
Variant
)
Dim
lngI
As
Long
Dim
aletzte
As
Long
Dim
zletzte
As
Long
Dim
spalte
As
Variant
Dim
wsA
As
Worksheet
Set
wsA = ActiveSheet
aletzte = wsA.Cells(Rows.Count, 1).
End
(xlUp).Row + 1
With
wsTab
zletzte = .Cells(Rows.Count, 1).
End
(xlUp).Row:
If
zletzte = 2
Then
zletzte = 1
For
lngI = LBound(Data)
To
UBound(Data)
spalte = SpaltenName(Data(lngI))
wsA.Range(wsA.Cells(1, spalte), wsA.Cells(aletzte, spalte)).Copy Destination:=.Cells(zletzte, lngI + 1)
Next
lngI
If
zletzte > 1
Then
.Rows(zletzte).Delete shift:=xlShiftUp
End
With
End
Sub