In this code I have to Error Traps the first On Error GoTo 1 the second On Error GoTo 2 Why does this come up with an error I have not set up any DIM statements could this be the cause of the error code runtime error 91
Rich (BB code):
Sub Find_Chassis_No()
On Error GoTo 1
Application.ScreenUpdating = False
Application.CutCopyMode = False
MyReg = Range("C18").Value
Sheets("Allmachines Copy").Select
Columns("M:M").Select
Selection.Find(What:=MyReg, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
MyWK = Format(ActiveCell.Offset(0, -11).Value, "")
1 If MyWK > 0 Then GoTo 2
On Error GoTo 2
Sheets("Registration Numbers").Select
Columns("G:G").Select
Selection.Find(What:=MyReg, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
MyID = ActiveCell.Offset(0, -3).Value
Columns("A:A").Select
Selection.Find(What:=MyID, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
MyWK = Format(ActiveCell.Offset(0, 1).Value, "")
2 Range("A1").Select
Sheets("Details").Select
Range("B7").Value = MyWK
Range("C18").Value = ""
Range("C18").Select
Application.ScreenUpdating = True
End Sub