Getting specific text or tumber from cell

MyNameIsAryy

New Member
Joined
Sep 3, 2019
Messages
4
Hi Guys,

I've got a lot of cells with useless text and a combination of text + numbers in it that I need and by now I am out of ideas...



Sometimes it looks like this:

Useless-Text_CD_local random, name (randomname) 2019-10-17T08:20:15 XYZ-COUNTRY-000737


Or like this:
Useless-Text_CD_local random, name (randomname) 2019-10-17T08:20:15 XYZ COUNTRY 735

I always need the part after the "date / time" part which says XYZ COUNTRY 735 or XYZ-COUNTRY-000737


I've tried to use a formula like
=TRIM(LEFT(SUBSTITUTE(MID(B2;FIND("BPP";B2);LEN(B2));" ";WIEDERHOLEN(" ";100));100))

This returns the correct text/number but only if they are connected with -. So it's not working for XYZ COUNTRY Numbers.


I would really appreciate if someone has any solution. VBA would also be great due to the fact that the rest of my form is created via VBA.


BR Aryy
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,105
Members
453,021
Latest member
Justyna P

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