Error Handle

Is there any function that returns an error or not?

Like.. If error(!xxx. type eq 'GASK' ) then .....

Instead of error handling, I want to use a function that can return fail or not...

Excel VBA has a function like "Iserror()" that returns true or false....

I am a beginner....so please help..