PDA

View Full Version : Code to allow A Customers ID to only go in a spread up to 3 times?



flashdazza
06-15-2008, 12:09 PM
I have created a spreadsheet to place the Customers ID into and a games they have selected in the userform.

They can only do this 3 times so is there a way of only allowing this up to 3 times?

Simon Lloyd
06-16-2008, 12:47 AM
considering you haven't provided much information or an example this is the best you will get!
Dim IdCount as long
IdCount=Application.WorksheetFunction.=COUNTIF(Range("A1:A20"),"CUSTOMER ID HERE")
If IdCount>3 Then
MsgBox "ID Count Exceeded", "Registration Count"
End If