Sie sind auf Seite 1von 2

Private Sub CommandButton1_Click()

Dim emptyRow As Long


Sheet1.Activate
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
Cells(emptyRow, 1).Value = TextBox1.Value
Cells(emptyRow, 2).Value = TextBox2.Value
Cells(emptyRow, 3).Value = ListBox1.Value
Cells(emptyRow, 4).Value = ComboBox1.Value
If CheckBox1.Value = True Then Cells(emptyRow, 5).Value = CheckBox1.Caption
If CheckBox2.Value = True Then Cells(emptyRow, 5).Value = Cells(emptyRow, 5).Value
& " " & CheckBox2.Caption

If CheckBox3.Value = True Then Cells(emptyRow, 5).Value = Cells(emptyRow, 5).Value


& " " & CheckBox3.Caption

If OptionButton1.Value = True Then


Cells(emptyRow, 6).Value = "Yes"
Else
Cells(emptyRow, 6).Value = "No"
End If

Cells(emptyRow, 7).Value = TextBox3.Value

End Sub

Private Sub CommandButton2_Click()


TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
ListBox1.Value = ""
ComboBox1.Value = ""
CheckBox1.Value = False
CheckBox2.Value = False
CheckBox3.Value = False
OptionButton1.Value = False
End Sub

Private Sub CommandButton3_Click()


Unload Me
End Sub

Private Sub SpinButton1_Change()


TextBox3.Text = SpinButton1.Value
End Sub

Private Sub UserForm_Click()

End Sub

Private Sub UserForm_Initialize()


TextBox1.Value = ""
TextBox2.Value = ""
ListBox1.Clear
With ListBox1
.AddItem "Jammu"
.AddItem "delhi"
.AddItem "mumbai"
.AddItem "kerala"
.AddItem "karnatka"
.AddItem "maharasthra"
.AddItem "orissa"
End With

ComboBox1.Clear
With ComboBox1
.AddItem "VEG"
.AddItem "NON VEG"
.AddItem "CHINESE"
End With

CheckBox1.Value = False
CheckBox2.Value = False
CheckBox3.Value = False

OptionButton1.Value = True
TextBox3.Value = ""
End Sub

Das könnte Ihnen auch gefallen