das komma soll weg
22.02.2004 21:16:27
sLy
Sub ArtikelINtxt()
Dim rng As Range
Dim iRow As Integer, iCol As Integer, iFile As Integer
Dim sFile As String, sTxt As String
Set rng = Range("A1").CurrentRegion
sFile = ThisWorkbook.Path & "\" & "Artikeldaten.txt"
iFile = FreeFile
Open sFile For Output As iFile
For iRow = 1 To rng.Rows.Count
For iCol = 1 To rng.Columns.Count
sTxt = sTxt & Cells(iRow, iCol).Value & ","
Next iCol
sTxt = Left(sTxt, Len(sTxt) - 1)
Print #iFile, sTxt
sTxt = ""
Next iRow
Close iFile
rng.ClearContents
End Sub
Sub ArtikelOUTtxt()
Dim iRow As Integer, iFile As Integer
Dim sFile As String, sTxtA As String, sTxtB As String, sTxtC As String
sFile = ThisWorkbook.Path & "\" & "Artikeldaten.txt"
If Dir(sFile) = "" Then
MsgBox "Die Artikeldaten konnten nicht geladen werden!"
Exit Sub
End If
iFile = FreeFile
Open sFile For Input As iFile
Do Until EOF(iFile)
Input #iFile, sTxtA, sTxtB, sTxtC
iRow = iRow + 1
Cells(iRow, 1).Value = sTxtA
Cells(iRow, 2).Value = sTxtB
Cells(iRow, 3).Value = sTxtC
Loop
Close
End Sub