Private Sub CommandButton1_Click()
Dim emptyRow As Long
Dim myRange As Excel.Range
Dim sSuchWert As String
Dim retV As Variant
sSuchWert = TextBox1.Value
Set myRange = Worksheets("Tabelle3").Range("A:A")
'Nachgefragt: Was wird das?
'emptyRow = WorksheetFunction.CountA(myRange) + 1
If TextBox1.Value = "" Then MsgBox "Bitte Namen eingeben!": Exit Sub
retV = Application.Match(sSuchWert, myRange, 0)
If Not IsError(retV) Then
MsgBox "Du hast schon abgestimmt!"
Else
''Nachgefragt: Was wird das?
' myRange.Cells(emptyRow, 1).Value = TextBox1.Value & _
'Show.TeamEvent2020 'Öffne das 2. Formular
'Formular laden
TeamEvent2020.Show
End If
End Sub
|