Copy a word from a cell with a sentence in it

leeksleeks

Board Regular
Joined
Oct 31, 2013
Messages
96
Hi,

I am having trouble trying to write some code that will extract a word(s) from a cell that has asentence in it as can be seen below:[TABLE="width: 50"]
<tbody>[TR]
[TD][TABLE="width: 655"]
<tbody>[TR]
[TD="width: 655"](Class 4) (4yo+) 2m3f Heavy 10 hdles[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
I have tried Text to Columns but when I change from Race to race the amount of information changes and everything parts of words are chopped off and split into other cells etc. What iw ant is to be able to extract Class (Class4), the distance (2m3f) and the going (Heavy). I then want to copy that information from a worksheet called 'Meeting to a worksheet called 'Results'.

Much the same as above when a cell has:

[TABLE="width: 50"]
<tbody>[TR]
[TD][TABLE="width: 655"]
<tbody>[TR]
[TD="width: 655"]<!-- -->Vinetta 16/1 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
or
[TABLE="width: 50"]
<tbody>[TR]
[TD][TABLE="width: 655"]
<tbody>[TR]
[TD="width: 655"]<!-- -->Croco Bay (IRE) 16/1 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

How do I copy just the 16/1 onto the worksheet called "Results".

Any help you can provide will be very helpful.

Cheers
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
These are tricky, at least for me. Not sure how it will work on your other entries but you can tweak a bit.
Change the sheet names to suit your worksheets.

Code:
 In cell B2 of sheet1    (Class 4) (4yo+) 2m3f Heavy 10 hdles

 In cell A3 of sheet2   =LEFT(Sheet1!B2,FIND(") (",Sheet1!B2))
 In cell B3 of sheet2   =MID(Sheet1!B2,FIND(") ",Sheet1!B2,10)+2,4)
 In cell C3 of sheet2   =MID(Sheet1!B2,FIND(Sheet2!D21,Sheet1!B2)+LEN(B3),6)


In cell B4 of sheet1   Vinetta 16/1

 In cell D3 of sheet2  =RIGHT(Sheet1!B4,4)  or  =RIGHT(Sheet1!B4,5)

Regards,
Howard
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top