Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
384to388
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
384to388
384to388
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

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

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
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
-

304 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige