Thread: date format
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] duncan.mutchblache@googlemail.com is offline
external usenet poster
 
Posts: 4
Default date format

Assuming xl2000 or later:

Dim s1 as String, s2 as String
s1 = Date1t.text
s2 = Date2t.text
s1 = Replace(s1,".","/")
s2 = Replace(s2,".","/")


if isdate(s1) then
Date1 = cdate(s1)
else
msgbox "Bad date"
Date1t.Text = ""
exit sub
end if
if isdate(s2) then
Date2 = cdate(s2)
else
msgbox "Bad Date"
Date2t.Text
exit sub
End if


--
Regards,
Tom Ogilvy



Tom,

For some reason I cannot get this to work, dont know why? ive run
through it with F8 and it goes through the code but doesnt replace
anything.

Any ideas what might be wrong?

Duncan