Textbox nimmt nichts an
27.01.2004 12:03:02
Walter MB
ich hoffe es kann mir jemand helfen.
Habe eine UserForm1 erstellt und einem CommandButton3.
Mit dem Button rufe ich eine UserForm3 auf, darin befindet sich eine
Textbox1. Hier soll von der aktiven Mappe und der AKTIVEN Zelle der Wert
(hier das Datum) in die Textbox1 reingesetzt werden.
Dies steht in CommandButton3:
Private Sub CommandButton3_Click()
Dim z As Long
ActiveSheet.Unprotect ("bk") 'schutz aufheben
UserForm1.Hide
If ActiveCell.Row < 4 And ActiveCell.Column < 24 Then
MsgBox "Achtung Sie haben die falsche Zelle + Spalte ausgewählt! " _
& Chr(13) & Chr(13) & " Zelle:" & " " & ze & _
" Spalte:" & " " & sp & Chr(13) & Chr(13) & _
"Die Z e i l e n 1, 2 + 3 und" & Chr(13) & _
"die S p a l t e n 1 bis 23" & Chr(13) & _
Chr(13) & "Sie können diese Zeile nicht kalkulieren !" & Chr(13) & _
"Neue Zeile auswählen" & Chr(13), vbCritical
Exit Sub
End If
z = ActiveCell().Row
ActiveSheet.Range(Cells(z, 2), Cells(z, 23)).Select
ActiveSheet.Range(Cells(z, 2), Cells(z, 2)).Select
TextBox1 = Format(ActiveCell.Offset(0, 0).Value, ("dd.mm. yyyy"))
UserForm3.Show
End Sub
Dies steht in Textbox1:
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If IsNumeric(TextBox1) = False And TextBox1 <> "" Then
MsgBox "Es sind nur nummerische Werte erlaubt."
TextBox1.SetFocus
With TextBox1
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
TextBox1 = "dd.mm. yyyy"
End If
TextBox1 = Format(ActiveCell.Offset(0, 0).Value, ("dd.mm. yyyy"))
TextBox1.SetFocus
With TextBox1
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub
Was muß ich ändern ???
Gruss Walter