I am trying to set up a data entry box for entering names and division. But it gives me an Compile error: Invalid use of property at the Clear controls "TextName.Text". I am very new at this so it may sound like a simple question. Thanks in advance!
Private Sub OKButton_Click()
' Make sure sheet one is active
Sheets("Sheet1").Activate
' Determine the next empty row
Dim NextRow As Long
NextRow = Application.WorksheetFunction.CountA(Range("A:A")) + 1
' Transfer the name
Cells(NextRow, 1) = TextName.Text
' Transfer the division
If OptionAdult Then Cells(NextRow, 2) = "Adult"
If OptionYouth Then Cells(NextRow, 2) = "Youth"
If OptionPeewee Then Cells(NextRow, 2) = "Unknown"
' Clear the controls for the next entry
TextName.Text ""
OptionPeewee = True
TextName.SetFocus
End Sub
Private Sub OKButton_Click()
' Make sure sheet one is active
Sheets("Sheet1").Activate
' Determine the next empty row
Dim NextRow As Long
NextRow = Application.WorksheetFunction.CountA(Range("A:A")) + 1
' Transfer the name
Cells(NextRow, 1) = TextName.Text
' Transfer the division
If OptionAdult Then Cells(NextRow, 2) = "Adult"
If OptionYouth Then Cells(NextRow, 2) = "Youth"
If OptionPeewee Then Cells(NextRow, 2) = "Unknown"
' Clear the controls for the next entry
TextName.Text ""
OptionPeewee = True
TextName.SetFocus
End Sub