Hi all,
I have a nice little seating chart setup running in Excel (thanks Andy!). There are up to 157 seats that could be sold each night, and one person may buy up to 8 seats.
My main problem remaining is that the seats are named A1-A11, B1-B18, C1-C18...H1-H18 and I1-I20. Unfortunately, I can enter an incorrect seat number, e.g. A200. How can I make it so that only the correct seats may be entered? I don't want to use a drop down list, but do have a list of the correct seat numbers in a column on the sheet.
The current code, which prevents selling duplicate seats is:
Private Sub Worksheet_Change(ByVal Target As Range)
If Selection.Cells.Count > 1 Then Exit Sub
If WorksheetFunction.CountIf(Range("Ag5:An161"), Target) > 1 Then
MsgBox "Already sold."
Target = ""
End If
End Sub
Thanks in advance!
I have a nice little seating chart setup running in Excel (thanks Andy!). There are up to 157 seats that could be sold each night, and one person may buy up to 8 seats.
My main problem remaining is that the seats are named A1-A11, B1-B18, C1-C18...H1-H18 and I1-I20. Unfortunately, I can enter an incorrect seat number, e.g. A200. How can I make it so that only the correct seats may be entered? I don't want to use a drop down list, but do have a list of the correct seat numbers in a column on the sheet.
The current code, which prevents selling duplicate seats is:
Private Sub Worksheet_Change(ByVal Target As Range)
If Selection.Cells.Count > 1 Then Exit Sub
If WorksheetFunction.CountIf(Range("Ag5:An161"), Target) > 1 Then
MsgBox "Already sold."
Target = ""
End If
End Sub
Thanks in advance!