AW: Userform - Intelligente Datenzuordnung
19.07.2018 16:17:20
ChrisL
Hi Sarah
muss gleich weg...
Private Sub OKCommandButton_Click()
Dim emptyRow As Long
If Not IsDate(DateTextBox) Then
MsgBox "kein Datum"
Exit Sub
End If
With Worksheets("Sheet1")
If WorksheetFunction.CountIf(.Columns(1), CLng(CDate(DateTextBox))) = 0 Then _
.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) = CDate(DateTextBox)
emptyRow = Application.Match(CLng(CDate(DateTextBox)), .Columns(1), 0)
'Transfer information
.Cells(emptyRow, 2).Value = KolliTextBox.Value
.Cells(emptyRow, 6).Value = HoursTextBox.Value
.Cells(emptyRow, 10).Value = AmountTextBox.Value
.Cells(emptyRow, 14).Value = SelleriePTextBox.Value
.Cells(emptyRow, 15).Value = SellerieKTextBox.Value
.Cells(emptyRow, 20).Value = PorreePTextBox.Value
.Cells(emptyRow, 21).Value = PorreeKTextBox.Value
.Cells(emptyRow, 26).Value = MoehrenPTextBox.Value
.Cells(emptyRow, 27).Value = MoehrenKTextBox.Value
.Cells(emptyRow, 32).Value = PetersiliePTextBox.Value
.Cells(emptyRow, 33).Value = PetersilieKTextBox.Value
End With
Call UserForm_Initialize
'Unload Me 'close Userform
End Sub
und TabIndex Eigenschaft
cu
Chris