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
 

Some videos you may like

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
35,515
Office Version
365
Platform
Windows
Howa about
=MID(B2,SEARCH("T??:",A14)+10,100)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
35,515
Office Version
365
Platform
Windows
You're welcome & thanks for the feedback
 

Forum statistics

Threads
1,089,238
Messages
5,407,078
Members
403,122
Latest member
Anar1046

This Week's Hot Topics

Top