LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Searching for text and returning text

Hi Greg,

Am Fri, 14 Jun 2013 04:40:01 +0100 schrieb GreggyR:

I have a list of products with their sizes all in one cell (for example
"Marlboro 25s"), I would like to search that specific cell for a piece
of text relating to the size (for example "25s") and return just that in
a separate cell.


if your product is always in one word and there is only one space in
front of the size into that cell you can try:
=MID(A1,FIND(" ",A1)+1,10)
If product can be more than one word but the size is always behind the
last space try that function:

Function Sizes(myCell As Range) As String
Dim myStart As Integer
myStart = InStrRev(myCell, " ")
Sizes = Mid(myCell, myStart + 1, 10)
End Function

In B1 write:
=Sizes(A1)


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
 
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
searching for text and returning information Doug Excel Discussion (Misc queries) 0 November 9th 09 07:49 PM
searching for text inside a text box wildetudor Excel Discussion (Misc queries) 0 January 21st 09 02:16 PM
Returning a text by searching the whole workbook Sai Krishna[_2_] Excel Discussion (Misc queries) 2 June 16th 08 06:08 AM
Code for searching & copying Text from 1 text file to another J@Y Excel Programming 2 June 27th 07 04:16 PM
Finding text in a cell and returning a value based on that text [email protected] Excel Discussion (Misc queries) 5 January 10th 07 06:01 PM


All times are GMT +1. The time now is 03:55 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"