Laufzeitfehler '6' - Überlauf
29.09.2005 08:55:18
Ralf
Sub Daten_einlesen()
'
' Daten_einlesen Makro
' Makro am 22.08.2005 von Ralf Hauke aufgezeichnet
'
Dim vAct As Variant
Dim iRow As Integer, iCol As Integer
Dim sTxt As String, sTmp As String
iRow = 8
Rows(iRow & ":" & Rows.Count).ClearContents
Close
Open "Z:\PLAN\UMS.txt" For Input As #1
Do Until EOF(1)
Line Input #1, sTxt
Do While Len(sTxt) > 1
iCol = 0
If InStr(sTxt, vbLf) > 1 Then
sTmp = Left(sTxt, InStr(sTxt, vbLf) - 1)
End If
Do While Len(sTmp) > 1
iCol = iCol + 1
vAct = Left(sTmp, InStr(sTmp, Chr(124)) - 1)
If InStr(vAct, ",") Then
vAct = WorksheetFunction.Substitute(vAct, ",", ".")
End If
Cells(iRow, iCol).Value = vAct
sTmp = Right(sTmp, Len(sTmp) - InStr(sTmp, Chr(124)))
Loop
sTxt = Right(sTxt, Len(sTxt) - InStr(sTxt, vbLf))
==> iRow = iRow + 1 (Wert iRow=32767)
Loop
Loop
Close