noch ne Frage zu Textboxen
08.02.2005 21:03:05
peter
trau mich kaum noch zu fragen, aber die Neugier siegt.
Wie greift man beim Auslesen der Textbox auf einzelne Spalten zu?
z.B. nur Spalte 1,2,5
Peter
Sub Import()
Dim intRow As Integer, intCol As Integer
Dim strTxt As String
With ActiveSheet
.Range("A1").CurrentRegion.ClearContents
Open "TestUser.txt" For Input As #1
Do Until EOF(1)
intRow = intRow + 1
intCol = 0
Line Input #1, strTxt
Do Until InStr(strTxt, ",") = 0
intCol = intCol + 1
.Cells(intRow, intCol) = Left(strTxt, InStr(strTxt, ",") - 1)
strTxt = Right(strTxt, Len(strTxt) - InStr(strTxt, ","))
Loop
.Cells(intRow, intCol + 1) = strTxt
Loop
End With
Close
End Sub