Userformzeigt nicht an!?
ing.grohn
meine Userform besteht aus genau 4 Textboxen. Die Userform soll mich über den Stand der Dateikonvertierung informieren. Ich seh aber nichts (die Userform schon, aber keine Zahlen)!
Warum nicht?
Hier der Code:
Sub Textdatei_lesen()
Dim Textzeile
Dim Datum1 As String
Dim Datum2 As String
Dim Anzahl As Long
Dim Satz As Long
Dim Hoehe As String
Dim Posi As Integer
Dim L As Integer
Dim Kyll As Double
Dim KyllM As Double
Dim Zeile As Integer
Anzahl = 1
Satz = 1
Zeile = 2
Open "C:\HP\Eigene Dateien\Kyll-Densborn.txt" For Input As #1 ' Datei öffnen.
Line Input #1, Textzeile
Line Input #1, Textzeile
Datum1 = Left(Textzeile, 10)
Posi = InStr(12, Textzeile, vbTab)
L = Len(Textzeile)
Hoehe = Mid(Textzeile, Posi + 1, L - Posi)
L = Len(Hoehe)
Kyll = Val(Left(Hoehe, L - 2) & "." & Right(Hoehe, 1))
Anzahl = Anzahl + 1
Satz = Satz + 1
KyllM = Kyll
Workbooks("Densborn-Regen.xls").Activate
Sheets("Tabelle2").Select
Load UF_Kyll
UF_Kyll.Show
Do While Not EOF(1) ' Schleife bis Dateiende.
Line Input #1, Textzeile ' Zeile in Variable einlesen.
Datum2 = Left(Textzeile, 10)
Posi = InStr(12, Textzeile, vbTab)
L = Len(Textzeile)
Hoehe = Mid(Textzeile, Posi + 1, L - Posi)
L = Len(Hoehe)
Kyll = Val(Left(Hoehe, L - 2) & "." & Right(Hoehe, 1))
If Datum1 Datum2 Then
KyllM = KyllM / Anzahl
Anzahl = 1
Cells(Zeile, 1).Value = Datum1
Cells(Zeile, 2).Value = KyllM
UF_Kyll.TextBox3.Value = Datum1
UF_Kyll.TextBox4.Value = Format(KyllM, "#0.00 ")
UF_Kyll.TextBox2.Value = Format(Zeile, "#0 ")
Zeile = Zeile + 1
KyllM = 0
Datum1 = Datum2
End If
KyllM = Kllm + Kyll
Anzahl = Anzahl + 1
If Satz = 350 Then MsgBox (Satz)
UF_Kyll.TextBox1.Value = Format(Satz, "#0 ")
Satz = Satz + 1 ' Ausgabe im Direktfenster.
UF_Kyll.Repaint
Loop
Close #1 ' Datei schließen.
End Sub
Für eine Antwort bedanke ich mich
Mit freundlichen Grüßen