Option
Explicit
Sub
SpalteKopieren()
Const
QUELLTABELLE
As
String
=
"Tabelle1"
Const
ZIELTABELLE
As
String
=
"Tabelle2"
Const
QUELLSPALTE
As
String
=
"A"
Dim
rngQuelle
As
Range, c
As
Range
Dim
lngZielspalte
As
Long
With
Sheets(ZIELTABELLE)
lngZielspalte = 1
Set
c = .UsedRange
If
c.Address <> .Cells(1).Address
Then
lngZielspalte = c.Columns(c.Columns.Count).Offset(, 1).Column
End
If
End
With
Set
c =
Nothing
With
Sheets(QUELLTABELLE).Columns(QUELLSPALTE)
On
Error
Resume
Next
Set
c = .ColumnDifferences(Comparison:=.Cells(.Rows.Count))
On
Error
GoTo
0
If
Not
c
Is
Nothing
Then
c.Copy Destination:=Sheets(ZIELTABELLE).Columns(lngZielspalte).Cells(1)
End
If
End
With
End
Sub