Extract date from string of text

B

bluegirl

is there a macro that can look at a string of text like this " 10
(#0-265)(09/19/02)" and pull out the date.. 09/19/02 and delet
everthing else in the cell?


thanks in advance
 
F

Frank Kabel

Hi
is your data always strctured this was. e.g. the date at the end in the
format MM/DD/YY enclosed in brackets. If yes you may use a worksheet
function in a separate cell
=--MID(A1,LEN(A1)-9,8)
and copy down (format this cell as 'Date'
 
A

Adarsh Sharma

U can use right() or left() function in conjunction with a
loop to convert the values. like

myStr = Left(Worksheets("vna").Cells(Ex, Ey).Value, 4) '
Returns "H".
 
G

Greg Koppel

How about a formula instead? Assuming the string is in A1,

=Value(Left(Right(A1, 9), 8))

HTH, Greg
 
D

Dave Peterson

If you're still there and your data is formatted consistently, you may want to
try:

Data|text to columns

Maybe you can pick out the date field and skip all the rest.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top