Private
Sub
UserForm_Initialize()
TextBoxPm.Value = ActiveSheet.Name
TextBoxPm.Enabled =
False
Dim
i3
As
Integer
With
ComboBox_Position
For
i3 = 1
To
14
.AddItem
CInt
(i3)
Next
End
With
TextBox_Name.Value = Application.UserName
TextBox_Name.Enabled =
False
TextBox_Datum.Value = Now
TextBox_Datum.Enabled =
False
End
Sub
Private
Sub
CommandButton_Eingabe_Click()
Dim
last
As
Integer
last = ActiveSheet.Cells(Rows.Count, 1).
End
(xlUp).Row + 1
If
UserForm.TextBox_WT.Value =
""
And
UserForm.TextBoxBemerkung.Value =
"Administrator"
Then
Sheets(
"Einstellungen"
).Visible =
True
:
GoTo
ENDE
Cells(last, 1).Value = UserForm.TextBoxPm.Value
Cells(last, 2).Value = Format(UserForm.TextBox_WT,
"000"
)
Cells(last, 3).Value = Format(UserForm.ComboBox_Position,
"0000"
)
If
CheckBox7.Value =
True
Then
Cells(last, 4).Value =
"Aus Anlage entnommen"
If
CheckBox8.Value =
True
Then
Cells(last, 4).Value =
"In Anlage eingesetzt"
If
CheckBox5.Value =
True
Then
Cells(last, 4).Value =
"Austausch"
If
CheckBox6.Value =
True
Then
Cells(last, 4).Value =
"Reinigung"
If
CheckBox5.Value =
True
And
CheckBox6.Value =
True
Then
Cells(last, 4).Value =
"Austausch und Reinigung"
End
If
If
CheckBox1.Value =
True
Then
Cells(last, 5).Value =
"Ja"
If
CheckBox2.Value =
True
Then
Cells(last, 5).Value =
"Nein"
If
Cells(last, 5).Value =
"Ja"
Then
Cells(last, 5).Interior.Color = vbRed
If
CheckBox3.Value =
True
Then
Cells(last, 6).Value =
"Links"
If
CheckBox4.Value =
True
Then
Cells(last, 6).Value =
"Rechts"
Cells(last, 7).Value = TextBoxBemerkung.Value
Cells(last, 8).Value = TextBox_Name.Value
Cells(last, 9).Value = TextBox_Datum.Value
ENDE:
Unload UserForm
ThisWorkbook.Save