Is there a "trick" to using the .find method in VBA to find a Date value?
I have always used something like this to find string values:
where varString is a character string.
It works great. However, when searching for a date value, it's not working the same way.
I've tried many things:
- declaring varString as a date value
- search for CDate(varString)
- using various format strings on the date
Any other suggestions are greatly appreciated. Thanks!
Dennis
I have always used something like this to find string values:
Code:
Set x = ws.Rows("1:1").Find(varString, LookIn:=xlValues)
where varString is a character string.
It works great. However, when searching for a date value, it's not working the same way.
I've tried many things:
- declaring varString as a date value
- search for CDate(varString)
- using various format strings on the date
Any other suggestions are greatly appreciated. Thanks!
Dennis