Extract special Textblock from String

User avatar
Stefan_Sand
4StarLounger
Posts: 415
Joined: 29 Mar 2010, 11:50
Location: Vienna, Austria

Extract special Textblock from String

Post by Stefan_Sand »

Hello,

i have a huge list of Booked times for a customer, and some of the booked hours correspond to a special ticket number.
The problem of the text is, that the ticketnumber is standing wherever the tester and developer mentions it.

But the certain string always starts with CC-. Is there a formula to get the string containig always combinations of thext and text like:
CC-35293-D9G5 out of it?

Stefan
Text from Ticketlist.xlsx
You do not have the required permissions to view the files attached to this post.

User avatar
SpeakEasy
4StarLounger
Posts: 563
Joined: 27 Jun 2021, 10:46

Re: Extract special Textblock from String

Post by SpeakEasy »

Something like

=MID(A18,SEARCH("CC",A18),13)

User avatar
Stefan_Sand
4StarLounger
Posts: 415
Joined: 29 Mar 2010, 11:50
Location: Vienna, Austria

Re: Extract special Textblock from String

Post by Stefan_Sand »

thank you, cool.

User avatar
DocAElstein
5StarLounger
Posts: 603
Joined: 18 Jan 2022, 15:59
Location: Re-routing rivers, in Hof, Beautiful Bavaria

Re: Extract special Textblock from String

Post by DocAElstein »

Hi
Just a quick heads up: I think the formula will error on those cells not containing CC. (In the uploaded file some cells don’t contain a CC) I don't know if that is of concern?, - so just mentioning it in case.
Alan
You do not have the required permissions to view the files attached to this post.
Last edited by DocAElstein on 09 Apr 2024, 21:46, edited 1 time in total.
I seriously don’t ever try to annoy. Maybe I am just the kid that missed being told about the King’s new magic suit, :(

snb
4StarLounger
Posts: 586
Joined: 14 Nov 2012, 16:06

Re: Extract special Textblock from String

Post by snb »

Code: Select all

Sub M_snb()
   columns(1).replace "*CC-","CC-"
   columns(1).replace " *",""
End Sub
You can do this manually too.

User avatar
Stefan_Sand
4StarLounger
Posts: 415
Joined: 29 Mar 2010, 11:50
Location: Vienna, Austria

Re: Extract special Textblock from String

Post by Stefan_Sand »

cool thanks