Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Find text in between to knowns

I am currently taking a long string and converting it from text to
columns. I am trying to extract the text in between the "Title:" and
"Start" As you can see below, when I convert to columns, I have
different columns and the number of cells the title occupies varies as
well.

A B C D
E F G
Template Title: National Folk Festival Start
Title: Washington, DC (one day
tour) Start
Title: The Parks Start
Title: The Parks Start

In the end I need it to look like
A B C D E
National Folk Festival
Washington, DC (one day tour)
The Parks
The Parks

I have a lot of rows of this type of data, so I need VB to do it
automatically for me. Any help you can give is appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Find text in between to knowns

On Jul 9, 4:29 pm, wrote:
I am currently taking a long string and converting it from text to
columns. I am trying to extract the text in between the "Title:" and
"Start" As you can see below, when I convert to columns, I have
different columns and the number of cells the title occupies varies as
well.

A B C D
E F G
Template Title: National Folk Festival Start
Title: Washington, DC (one day
tour) Start
Title: The Parks Start
Title: The Parks Start

In the end I need it to look like
A B C D E
National Folk Festival
Washington, DC (one day tour)
The Parks
The Parks

I have a lot of rows of this type of data, so I need VB to do it
automatically for me. Any help you can give is appreciated.


You can use a function, copy and paste the values of the function, and
then do a text to columns.

=MID(A2,FIND(":",A2)+1,LEN(A2)-FIND(":",A2)-5)

FIND locates the position number of the string that you want to find
LEN counts the number of characters in the string
and the -5 is for the number of characters in the word "Start"

Thus, MID will start at the ":" position and take the number of
characters from the ":" to the end -5 for the word "Start"

This should work.

Matt

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Find text in between to knowns

On Jul 9, 5:16 pm, wrote:
On Jul 9, 4:29 pm, wrote:





I am currently taking a long string and converting it from text to
columns. I am trying to extract the text in between the "Title:" and
"Start" As you can see below, when I convert to columns, I have
different columns and the number of cells the title occupies varies as
well.


A B C D
E F G
Template Title: National Folk Festival Start
Title: Washington, DC (one day
tour) Start
Title: The Parks Start
Title: The Parks Start


In the end I need it to look like
A B C D E
National Folk Festival
Washington, DC (one day tour)
The Parks
The Parks


I have a lot of rows of this type of data, so I need VB to do it
automatically for me. Any help you can give is appreciated.


You can use a function, copy and paste the values of the function, and
then do a text to columns.

=MID(A2,FIND(":",A2)+1,LEN(A2)-FIND(":",A2)-5)

FIND locates the position number of the string that you want to find
LEN counts the number of characters in the string
and the -5 is for the number of characters in the word "Start"

Thus, MID will start at the ":" position and take the number of
characters from the ":" to the end -5 for the word "Start"

This should work.

Matt- Hide quoted text -

- Show quoted text -


Sorry, I forgot to mention that you need to add the TRIM function into
the set. If you have spaces AFTER the word "Start" then the -5 won't
return what you are looking for. TRIM takes off the spaces infront
and behind the text.

Matt

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search, find or lookup defined text in text string zzxxcc Excel Worksheet Functions 9 September 6th 07 09:37 PM
can you find specific text in a string ignoring any other text chriscp Excel Discussion (Misc queries) 1 September 18th 05 09:54 PM
open some txt files ,find text , copy the text before that to a single cell gus Excel Programming 2 July 11th 05 05:40 PM
find and delete text, find a 10-digit number and put it in a textbox Paul Excel Programming 3 November 16th 04 04:21 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


All times are GMT +1. The time now is 09:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"