Hallo,
mein Vorschlag für das erste Makro, 4 (nicht 5) Spalte aus einer CSV-Datei zu importieren. (An einem Beispiel getestet)
Sub test()
'Makro in Workbook "Auswertung.xlsm"
Dim WBZ As Workbook 'Ziel
Dim WBQ As Workbook 'Quelle
sPath = "c:\tmp\"
sFile = "Daten.csv"
Set WBZ = ThisWorkbook
Set WBQ = Workbooks.Open(sPath & sFile)
WBQ.Sheets(1).Range("a2:d15").Copy WBZ.Sheets(1).Cells(9, "A")
WBQ.Close 0
'Rekorder
Range("A9").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("A9"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=True, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1)), TrailingMinusNumbers:= _
True
Set WBZ = Nothing
Set WBQ = Nothing
End Sub
mfg
|