AW: Excel Userform falsches Format Eingabe in Textbox
10.01.2018 22:02:07
Thomas
Hallo Sepp,
zu erst entschuldige ich mich zwecks des Dateianhangs.
Bin halt neu in diesem Forum.
Nichts desto trotz hast Du geantwortet, was ich wirklich sehr schätze.
Ich schaue mir am Wochenende Deinen Code genauer an um diesen entsprechend in mein Formular einzubauen.
Super vielen Dank.
UserFormEingabeMAImMonat - 1
Private Sub cmbSpeichern_Click()
Dim xlblatt As Worksheet
Dim xlzelle As Range
Dim i As Long
Dim j As Long
Dim Zeit As Date
Set xlblatt = ActiveWorkbook.Worksheets("Kalender")
Set xlzelle = xlblatt.Range("a1")
' *** Eingabe Pr�fung ***
For i = 1 To 31 'xlzelle.CurrentRegion.Rows.Count - 1 ' ##### je nach Zeilen im Formular _
65533;ndern
If Me.Controls("lblZeile" & VBA.Format(Zeit, "hh")).Visible = True Then
If Me.Controls("Gekommentxt" & VBA.Format(Zeit, "hh")).Value "" Then
If IsDate(Me.Controls("Gekommentxt" & VBA.Format(Zeit, "hh")).Value) = False Th
en
MsgBox "Bitte keine Texte!", vbInformation
Me.Controls("Gekommentxt" & VBA.Format(Zeit, "hh")).SetFocus
Me.Controls("Gekommentxt" & VBA.Format(Zeit, "hh")).SelStart = 0
Me.Controls("Gekommentxt" & VBA.Format(Zeit, "hh")).SelLength = Len(Me.Cont
rols("Gekommentxt" & VBA.Format(Zeit, "hh")).Value)
Exit Sub
End If
End If
End If
Next
' *** �bergabe des Wertes in die Zeile ***
For i = 1 To 31 'xlzelle.CurrentRegion.Rows.Count - 1 ' #### Je nach Zeilen im Formular � _
nd
ern
If Me.Controls("lblZeile" & VBA.Format(Zeit, "hh")).Visible = True Then
If Me.Controls("Gekommentxt" & VBA.Format(Zeit, "hh")).Value Then
For j = 1 To xlzelle.CurrentRegion.Rows.Count - 1
If xlzelle.Offset(j, 13).Value = Me.Controls("lblZeile" & VBA.Format(Zeit,
"hh")).Caption Then
xlzelle.Offset(j, 5).Value = Me.Controls("Gekommentxt" & VBA.Format(Zeit
, "hh")).Value
xlzelle.Offset(j, 6).Value = Me.Controls("Pausetxt" & VBA.Format(Zeit, "
hh")).Value
xlzelle.Offset(j, 7).Value = Me.Controls("Gegangentxt" & VBA.Format(Zeit
, "hh")).Value
xlzelle.Offset(j, 8).Value = Me.Controls("Bemerkungtxt" & VBA.Format(Zei
t, "hh")).Value
End If
Next
End If
End If
Next
ActiveWorkbook.Save
'Application.Quit
'Unload Me
End Sub