hi

i got this sheet that I am using I have a userform which has 3 down lists and then some other textbox for our typist to fill stuff in. what i want to do is search a column and if that column was a combined value of the three drop down lists then it needs to warn the user please see the below code.

Sheets("data").Select

Columns("o:o").Select
Id = Range("x5").Value

Selection.Find(What:=Id, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False).Activate

ActiveCell.Offset(0, 1).Select
If ActiveCell = 1 Then
CommandButton1.Enabled = False
CommandButton5.Enabled = True
Beep
MsgBox ("You have already entered in " & court.Value & " for " & Month.Value & " " & Year.Value)
CJHours.Value = ActiveCell.Offset(0, -12).Value
DJHours.Value = ActiveCell.Offset(0, -11).Value
HCHours.Value = ActiveCell.Offset(0, -10).Value
THours.Value = ActiveCell.Offset(0, -9).Value
MHours.Value = ActiveCell.Offset(0, -8).Value
Chours.Value = ActiveCell.Offset(0, -7).Value
OHours.Value = ActiveCell.Offset(0, -6).Value
Total.Value = ActiveCell.Offset(0, -5).Value
End If


it seems to work until I choose a value which is not in the list then it comes up with run-time error 91: object variable or with block variable not set. and debugs on the below part of the code

Selection.Find(What:=courtid, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False).Activate



what does this mean and how do I rectify the problem?


Many thanks in advance