Thread: Strange Values
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Duke Carey Duke Carey is offline
external usenet poster
 
Posts: 1,081
Default Strange Values

don't DIM fromDate as a String. The way your DIM statement reads, toDate is
a variant. Cast them both as Date

"Ashman" wrote:

Hi all,

I am wanting someone to help me with my problem. I have a problem with dates.

Dim toDate, fromDate as string

toDate = sheets("data").cells(2,5).value
fromDate = Sheets("data").cells(2,27).value

The problem is that the value for toDate = 1/7/2001 and the value for
fromDate = "1/7/2002".

How do I take the "" out, I have tried everything? The only difference in
the above is the cell reference.

Can anyone help or suggestions would be great?