Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

TextBox in UserForm

Forumthread: TextBox in UserForm

TextBox in UserForm
07.04.2003 09:12:04
Árpád Cserép
Es geht um UserForm und in diesem UserForm ein / mehrere TextBox-en.
Diese will ich so eine Eigenschaft geben, dass wenn ich eine Zeit
( 16:00 ) eingebe, diese durch shift : eintragen muss. Kann es so gemacht werden, dass dieser Doppelpunkt schon im TextBox anwesend is und ich nur die Zahlen vor und danach einführen muss.
Jetzt kann ich nur die Zeit betrennt durch ein Punkt (16.00) eintragen und dann rechnet es in der Celle nach hh:mm um.

Hier ist das Vorbild:

Private Sub CommandButton1_Click()
TextBox3.Text = Val(TextBox2.Text) - Val(TextBox1.Text)

ActiveCell.Select
ActiveCell.Offset(1, 0).NumberFormat = "[hh]:mm"
ActiveCell.Offset(1, 0).Value = TextBox3.Text / 24
End Sub

Private Sub CommandButton2_Click()
Unload Me
End Sub


Anzeige

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Re: TextBox in UserForm
11.04.2003 08:06:16
Willie

Erweiter deine Markos so dann funktioniert es
du mußt nur in Textbox1 und 2 z.B. 1200 und 1300 eingeben
wird dann in 12:00 und 13:00 umgewandelt

Gruß Willie

Private Sub CommandButton1_Click()

Dim wert, x, y, wert1, x1, y1

wert = TextBox1.Value
x = Right(wert, 2)
y = Left(wert, 2)
TextBox1.Value = y & ":" & x

wert1 = TextBox2.Value
x1 = Right(wert1, 2)
y1 = Left(wert1, 2)
TextBox2.Value = y1 & ":" & x1

TextBox3.Text = Val(TextBox2.Text) - Val(TextBox1.Text)

ActiveCell.Select
ActiveCell.Offset(1, 0).NumberFormat = "[hh]:mm"
ActiveCell.Offset(1, 0).Value = TextBox3.Value / 24
End Sub

Private Sub CommandButton2_Click()
Unload Me
End Sub

Anzeige
;

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige