OptionsButton
15.01.2004 08:54:10
Slimfast
Da ch bisher nur Makros fur Word-Perfect geschrieben habe tue ich mich ein wenig schwer mit der objektbezogen Programmierung.Ich habe da noch ein kleines Problem mit 2 OptionButton im Userform.
Ich habe 2 OpButtons wenn der Button aktiviert ist der Andere deaktiviert.
So weit so gut!
Wenn einer der Button aktiviert ist soll der Eintrag "X" in Tabelle1 geschrieben werde.
Kann ich das über die Eigenschaften einstellen oder muss da eine If-Abfrage her und wie soll diese aussehen?
Private Sub OptionButton1_Click()
End Sub
Private Sub OptionButton2_Click()
End Sub
oder direkt ?
Public Sub CommandButton1_Click()
arrPflicht = Array("ComboBox1", "Textbox3", "Textbox4", "Textbox5", "Textbox6", "Textbox8", "Textbox9", "Textbox12", "Textbox13", "Textbox14", "ComboBox2")
For C = 0 To UBound(arrPflicht)
If Me.Controls(arrPflicht(C)) = "" Then
MsgBox "Achtung Pflichtfeld! Bitte alles ausfüllen!"
Me.Controls(arrPflicht(C)).SetFocus
Exit Sub
End If
Next
z = Range("B1").End(xlDown).Row + 1
If z > 65000 Then z = 2
Cells(z, 1) = ComboBox1
Cells(z, 2) = TextBox1
Cells(z, 3) = TextBox2
Cells(z, 4) = TextBox3
Cells(z, 5) = TextBox4
Vielen Dank im Vorraus
Slimfast