Private
Sub
CommandButton1_Click()
Dim
emptyRow
As
Long
Dim
sSuchWert
As
String
Dim
retV
As
Variant
Dim
wks
As
Excel.Worksheet
Set
wks = ThisWorkbook.Worksheets(
"Tabelle3"
)
With
wks
emptyRow = IIf(IsEmpty(.Cells(.Rows.Count,
"A"
).Value), _
TruePart:=.Cells(.Rows.Count,
"A"
).
End
(xlUp).Row + 1, _
FalsePart:=.Cells(.Rows.Count,
"A"
).Row)
End
With
sSuchWert = TextBox1.Value
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
myRange.Cells(emptyRow, 1).Value = TextBox1.Value
TeamEvent2020.Show
End
If
End
Sub