ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VLookup function in VBA problem? (https://www.excelbanter.com/excel-programming/297969-re-vlookup-function-vba-problem.html)

Bill Buckner

VLookup function in VBA problem?
 
Chris

I still get a type mismatch. I checked the range for Range("Retire_Date_Primary") and it's a single cell

=Assumptions!$B$

Here is my actual line of code

retireDate = CVDate(Range("Retire_Date_Primary").Value

I tried CVDate as well as CDate function to convert it to a date and they both seem to be working. If I use the IsDate function it is true (of course it was true before I used your .Value suggestion. It prints out fine

When you said it has to be a value and not a range, Was that in reference to the VLookup function or the conversion to the retireDate variable

I'm using Excel 2000 in case that matters



All times are GMT +1. The time now is 04:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com