Dieser code:
Public Sub Text_einfügen()
Dim c1 As Variant, c2 As Variant, i1 As Long, i2 As Long, Ganzer_text As String, z As Long, s As Long
Ganzer_text = Aus_zwischenablage
Application.ScreenUpdating = False
c1 = Split(Ganzer_text, vbNewLine)
For i1 = LBound(c1) To UBound(c1)
s = 1: z = z + 1
c2 = Split(c1(i1), Chr(9))
For i2 = LBound(c2) To UBound(c2)
If i1 = 0 Then
Cells(z, s) = c2(i2)
Else
Cells(z, s) = c2(i2) * 1
Select Case i2
Case Is = 0
Cells(z, s).NumberFormat = "00.00"
Case Is = 1
Cells(z, s).NumberFormat = "0.0000"
Case Is = 2
Cells(z, s).NumberFormat = "0.0000"
Case Is = 3
Cells(z, s).NumberFormat = "0.00000"
Case Is = 4
Cells(z, s).NumberFormat = "0.00000"
Case Is = 5
Cells(z, s).NumberFormat = "0.00000"
End Select
End If
s = s + 1
Next i2
Next i1
With Range("A:F")
.Columns.AutoFit
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
Application.ScreenUpdating = True
End Sub
Public Function Aus_zwischenablage() As String
Dim IE As Object
'Dim CLP As String
On Error Resume Next
Set IE = CreateObject("HTMLfile")
Aus_zwischenablage = IE.ParentWindow.ClipboardData.GetData("text")
'MsgBox CLP
Set IE = Nothing
End Function
in ein Modul kopieren.
Jetzt einfach die Liste aus der Textdatei Kopieren einfach mit Strg + A und Strg + C.
Dann einfach in der Exceldatei das Sub von mir (Text_einfügen) ausführen.
am besten du machst mal eine Neue Mappe.
|