View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Noemi Noemi is offline
external usenet poster
 
Posts: 74
Default Incorrect Date Returned

Hi

I have a cell which is in text format. The cell is referenced as a string. I
then need to check to see if the entered date/number entered into the cell is
before todays date.

I use the following code to change the format of the cell number/date to
become an actual date however the wrong date is shown.

rngFromC = 281006

stFromaDateNameC = rngFromC

If stFromDateNameC <= 999999 Then
stFromDateNameC = Format(stFromDateNameC, "mm/dd/yy")
stFromDateNameC = DateValue(stFromDateNameC)
End If

when converted into date format it shows 13/05/1969

I dont understand why it doesn't show as 28/10/06.

Any idea's

Thanks
Noemi