Thread
:
Taking out string part which represents date
View Single Post
#
5
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
external usenet poster
Posts: 10,124
Taking out string part which represents date
OR to get May 2002
Sub getdatefromstring()
For Each c In Selection
x = Mid(c, InStrRev(c, "-") + 1, 4)
md = Format(DateSerial(Right(x, 2), Left(x, 2), 1), "mmm yyyy")
MsgBox md
Next c
End Sub
--
Don Guillett
SalesAid Software
"Don Guillett" wrote in message
...
try
Sub getdatefromstring()
For Each c In range("a2:a22")'Selection
x = Mid(c, InStrRev(c, "-") + 1, 4)
md = Format(DateSerial(2006, Left(x, 2), _
Right(x, 2)), "mm/dd/yyyy")
MsgBox md
Next c
End Sub
--
Don Guillett
SalesAid Software
"c8tz" wrote in message
oups.com...
Hi,
I have a string eg.125-64-0502L where 0502 represents May 2002 - how
can i specify that without doing so manually.
thanks in advance for your assistance,
c8tz~
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett