Howdy!
I have a code to search a table and return the exchange rate, but it's not working.
I'm getting the error on the marked line. Any help is appreciated. Thanks.Please Login or Register to view this content.
Howdy!
I have a code to search a table and return the exchange rate, but it's not working.
I'm getting the error on the marked line. Any help is appreciated. Thanks.Please Login or Register to view this content.
Last edited by NickNunes; 03-11-2019 at 06:19 AM.
First, you should never try and use the result of a Find operation without testing it was actually found. Second, what is fechadelcontrato? If it's a variable, where and how is it declared?
Remember what the dormouse said
Feed your head
fechadelcontrato is a public variable declared at the top of the code (Double checked, it's there)
How exactly do I check it was actually found? I'm using a value that I know for a fact it's in the table.Please Login or Register to view this content.
You test for Nothing:
Are the values in the range literal values, or the result of formulas? Do they include time parts, or are they just date values?Please Login or Register to view this content.
Just date values, not a result of a formula or anything. No time parts either.
Also, it is indeed returning nothing
Please Login or Register to view this content.
Last edited by NickNunes; 03-11-2019 at 07:16 AM. Reason: Pasted the code
If you use this instead of Find, does it find the value?
Please Login or Register to view this content.
Using that code I get error 424 object required
Sorry - change dayCount to be a Long, not Range.
And now I get a compiling error "object required"
Edit: My bad, forgot to delete the "Set" before. Now it worksPlease Login or Register to view this content.
Last edited by NickNunes; 03-11-2019 at 07:47 AM.
You don't need the Is Nothing test now, but really we should still test to make sure it was foind, like this:
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks