Extract date from string of text

  • Thread starter Thread starter bluegirl
  • Start date Start date
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
 
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'
 
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".
 
How about a formula instead? Assuming the string is in A1,

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

HTH, Greg
 
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.
 
Back
Top