Find all instances of strings between 2 different characters

jllevent

New Member
Joined
Feb 12, 2019
Messages
2
Hi,

I have text in a single excel cell which looks like this:

* Apple: some general text. * Pear: more text. * Orange:some more text.

I need to extract the each instance of the strings between the characters * and :, and put them in separate, adjacent cells.

e.g.

A1B1C1D1
Above TextApplePearOrange

<tbody>
</tbody>

Is there a way to do this with either excel formulas in each of the adjacent cells, or else via a macro?

Thanks in advance.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Last edited:
Upvote 0
Code Option:-

Code:
[COLOR="Navy"]Sub[/COLOR] MG12Feb22
[COLOR="Navy"]Dim[/COLOR] sp [COLOR="Navy"]As[/COLOR] Variant, Rng [COLOR="Navy"]As[/COLOR] Range, n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Set[/COLOR] Rng = Range("A1")
sp = Split(Rng, "*")
[COLOR="Navy"]For[/COLOR] n = 1 To 3
    Rng.Offset(, n) = Split(sp(n), ":")(0)
[COLOR="Navy"]Next[/COLOR] n
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,215,336
Messages
6,124,328
Members
449,155
Latest member
ravioli44

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