Sub Text_Import()
Dim i As Integer, sFile As Variant, strTxt As String, sPath As String, sTxt As String, sText As _
_
String
Dim objData As New DataObject, aryDS As Variant, c As Integer, feld As Variant
Dim varVar As Variant
Dim StartVerzeichnis As String
StartVerzeichnis = "\\ABC$\BC$\_Verzeichnis\test"
'Dialogfenster Öffnen
sFile = Application.GetOpenFilename _
("alle Dateien (*.txt), *.txt")
MsgBox sFile 'liest den ausgewählten Pfad der Datei ein
If sFile False Then
Close
Open sFile For Input As #1
i = 1
c = 0
Do While Not EOF(1)
Line Input #1, strTxt
strTxt = Replace(strTxt, """", "")
aryDS = Split(strTxt, ";")
If i = 1 Then
Cells(i, 1).Value = aryDS(0)
Else
For Each feld In aryDS
Cells(i, c + 1).Value = aryDS(c)
c = c + 1
Next
c = 0
End If
i = i + 1
Loop
Close
End If
Set objData = Nothing
End Sub
ChDir "X"
ChDir StartVerzeichnis
GreetZ Renée
ChDir StartVerzeichnis
sFile = Application.GetOpenFilename("Exceldateien (*.xls), *.xls")
GreetZ Renée