View Single Post
  #3   Report Post  
herbwarri0r herbwarri0r is offline
Junior Member
 
Posts: 8
Default

Quote:
Originally Posted by robert111
if cell A1 contains the text string "bob 18/1/06 fred 24/1/06 dick" you
can search for a number between 0 and 9 , this will return the position
of the various numbers within the string. Use the lowest number.
LEN(A1) will give you the string length, can you work with this?


--
robert111
------------------------------------------------------------------------
robert111's Profile: http://www.excelforum.com/member.php...o&userid=31996
View this thread: http://www.excelforum.com/showthread...hreadid=547812
Still a bit unsure of how I can do this in a macro. I can use;

ActiveCell = Application.SEARCH(0,ActiveCell,1)
ActiveCell = Application.SEARCH(1,ActiveCell,1)
ActiveCell = Application.SEARCH(2,ActiveCell,1)
ActiveCell = Application.SEARCH(3,ActiveCell,1) ....etc

But then how do I use the lowest number and use this to be the value of Start in the following?

With ActiveCell.Characters(Start:=118, Length:=8).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12

I also have the problem that each of my text strings has two dates through the data. So the above method would be fine to make the first date bold but I will have trouble making the second date bold. I suppose there must be a way as each date uses 8 characters. So the second date will have a start point of the ninth lowest value returned from using Application.Search.