Link to home
Start Free TrialLog in
Avatar of a_norton
a_norton

asked on

Run time error on DirectPrecedents.Select

Hello

I am struggling with my error handling in VBA (please refer below for an extract of code).

       Worksheet.Cells.Select

       On Error GoTo NoPrecedentCells
       Selection.DirectPrecedents.Select

NoPrecedentCells:

End Sub

Regardless of the "On Error" command, a run-time error 1004 (No cells were found) arises.

Can you assist in anyway.

Thanks and regards
Aidan
Avatar of Rgonzo1971
Rgonzo1971

Hi,

Have you verified in the VBE Options/ General  your Error Trapping Status

Break on All errors OR Break in Class Module OR Break on Unhandled Errors ( the right one)

Regards
Avatar of a_norton

ASKER

Hello,

My Error Trapping Status appears to be set to Break on Unhandled Errors...

Is this correct?  On this setting the problem does however persist :(
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks you so much!