if iserror vlookup

This is a discussion on if iserror vlookup within the Excel Questions forums, part of the Question Forums category; Hi,
I am trying to write a vlookup function in Excel but nothing is working.
All I want it to ...

Re: if iserror vlookup

Difficult to see how or why. Could you post your code as is now, and give a few more details as to what's in the table you're looking in and what values you're expecting, and what value you're supplying.

Re: if iserror vlookup

This is my entire code.

I need to return a date.

The date within the sheets "SANCTIONS" and "FATF OSFI WARNINGS" changes depending on what the country is. This is why I need to do a vlookup with the country (i.e. country as string, the user choose the cell that contains the country name)

The other sheets contain a date on range("b3") or range("b4") that is common for all country.

I then want to return the latest date within all those sheets for the selected country.

Re: if iserror vlookup

I was more interested to see your current code for the date_test function. You're doing the right thing by simplifying the problem. I see in the other code you still have lots of 'worksheetfunction'.
So is the date_test function returning #Value?

If you're calling these functions from a formula in the sheet it will jump out without giving an error if one is met. Instead, call the function from the immediate pane with the likes of:
?date_test("england")
or whatever country. Have a break point on the first line of the function, then step through the code with F8. You'll soon know where it errors.