AW: Mehrere Zeilen in eine Spalte transponieren
27.06.2012 12:22:26
Case
Hallo, :-)
probiere es mal so:
Option Explicit
Sub Main()
Dim lngTMP As Long
On Error GoTo Fin
Application.ScreenUpdating = False
With Tabelle2
lngTMP = IIf(IsEmpty(.Cells(.Rows.Count, 1)), _
.Cells(.Rows.Count, 1).End(xlUp).Row, .Rows.Count)
For lngTMP = 1 To lngTMP
.Range(.Cells(lngTMP, 1), .Cells(lngTMP, .Columns.Count) _
.End(xlToLeft).Columns).Copy
.Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial Transpose:=True
Next lngTMP
End With
Fin:
With Application
.CutCopyMode = True
.ScreenUpdating = True
End With
If Err.Number 0 Then MsgBox "Error: " & _
Err.Number & " " & Err.Description
End Sub
Wenn Du es öfters machen musst würde ich dann eine schnellere Variante vorschlagen. Für einmalig reicht das. ;-)
Servus
Case