Live-Forum - Die aktuellen Beiträge
Datum
Titel
16.10.2025 17:40:39
16.10.2025 17:25:38
Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Gefundene Werte im Format HH:MM?

Forumthread: Gefundene Werte im Format HH:MM?

Gefundene Werte im Format HH:MM?
24.02.2004 11:54:36
Ina
Hallo Forum,
wie kann ich es anstellen, dass die gefundenen Werte in meiner UserForm in den TextBoxen 2-5 und 7-17 im Format HH:MM angezeigt werden?


Private Sub CommandButton2_Click()
Dim myRange As Range, intIndex As Integer
If Trim$(TextBox1) <> "" Then
With Worksheets("SCHICHT1").Range("B8:B107")
Set myRange = .Find(What:=Trim$(TextBox1), LookIn:=xlValues, LookAt:=xlWhole)
If Not myRange Is Nothing Then
For intIndex = 1 To 5
Controls("TextBox" & CStr(intIndex)) = Cells(myRange.Row, intIndex + 1)
Next
For intIndex = 1 To 7
If Cells(myRange.Row, intIndex + 6) = "X" Then Controls("CheckBox" & CStr(intIndex)) = True
Next
For intIndex = 6 To 17
Controls("TextBox" & CStr(intIndex)) = Cells(myRange.Row, intIndex + 8)
Next
Set myRange = Nothing
Else
MsgBox "Kein Eintrag vorhanden.", 64, "Information"
End If
End With
End If
End If
End Sub

Wer kann mir helfen und den Code entsprechend umstricken??
Vielen Dak im Voraus!!
Gruss, Ina
Anzeige

4
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Gefundene Werte im Format HH:MM?
24.02.2004 12:04:04
Waltraud
Funktion: Controls("TextBox" & CStr(intIndex)) = Format(DEIN WERT, "HH:MM")
AW: Gefundene Werte im Format HH:MM?
24.02.2004 12:11:17
Ina
Hallo Waltraud,
vielen Dank für Deine Nachricht.
Vielleicht kannst Du mir noch einmal helfen und mir sagen, wo die Codezeile eingefügt werden muss, damit nur die TextBoxen 2-17 das Format hh:mm anzeigen??
Den Code habe ich von Nepumuk (bin leider noch VBA-Laie).
Danke, Ina
Anzeige
AW: Gefundene Werte im Format HH:MM?
24.02.2004 12:19:03
Waltraud

Private Sub CommandButton2_Click()
Dim myRange As Range, intIndex As Integer
If Trim$(TextBox1) <> "" Then
With Worksheets("SCHICHT1").Range("B8:B107")
Set myRange = .Find(What:=Trim$(TextBox1), LookIn:=xlValues, LookAt:=xlWhole)
If Not myRange Is Nothing Then
For intIndex = 1 To 5
if intIndex = 1 then
Controls("TextBox" & CStr(intIndex)) = Cells(myRange.Row, intIndex + 1)
else
Controls("TextBox" & CStr(intIndex)) = Format(Cells(myRange.Row, intIndex + 1),"HH:MM")
endif
Next
For intIndex = 1 To 7
If Cells(myRange.Row, intIndex + 6) = "X" Then Controls("CheckBox" & CStr(intIndex)) = True
Next
For intIndex = 6 To 17
if inIndex = 6 then
Controls("TextBox" & CStr(intIndex)) = Cells(myRange.Row, intIndex + 8)
else
Controls("TextBox" & CStr(intIndex)) = Format(Cells(myRange.Row, intIndex + 8),"HH:MM")
endif
Next
Set myRange = Nothing
Else
MsgBox "Kein Eintrag vorhanden.", 64, "Information"
End If
End With
End If
End If
End Sub

Anzeige
AW: Danke! o.T.
24.02.2004 12:59:37
Ina
-
;

Forumthreads zu verwandten Themen

Anzeige
Anzeige
Anzeige
Anzeige
Entdecke relevante Threads

Schau dir verwandte Threads basierend auf dem aktuellen Thema an

Alle relevanten Threads mit Inhaltsvorschau entdecken

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige