LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Find Text in Cell and Copy

OK. I guess I'm a tad bit lost. This finds the information but how do it get
it to provide and extract the information I want found? Out of that Data
string the end result I want extracted for me to use is "QT-WR9395.0435"

How can I get that one particular restult to be able to be used instead of
just identifying that it is there?

Sorry for not understanding how to do this. :(

"Joel" wrote:

You need to add code to get data from cells such as code below. I just
showed how to extract the strings from the data.

for Rowcount = 1 to 100
Data = Range("A" & RowCount)
'my code
next Rowcount



"Rob" wrote:

Thanks for the reply. But I do not understand the "Data" portion of this.
The "Data being searched through is going to always be different from one
cell to another. It looks like with tat "Data" portion it only allows for
just the one. Is that correct? How can I make this to search other cells
insead of just the one?


Thanks Very Much Again.



"Joel" wrote:

Try something like this

Sub SeperateString()

SearchStr = "QT-WR"
Data = "Q-6464694_QT-WR9395.0435_8586-44.05950.3_QT-WR9395"
Do While InStr(Data, "_") 0
FirstID = Left(Data, InStr(Data, "_") - 1)
Data = Mid(Data, InStr(Data, "_") + 1)
If Left(FirstID, Len(SearchStr)) = SearchStr Then
'enter Your code here
End If
Loop

'Add more code here for last item

End Sub


"Rob" wrote:

Hello,

I am trying to find some sort of code that will ease the pain of my task.
What I am needing to do is find a certain string of text within a cell and
copy it to another cell. The catch is that the text is variable in it total
content but the info I need is similar but not exactly the same nearly all
the time. Example below.

The text in cell (B2)...
Q_6464694_QT-WR9395.0435_8586-44.05950.3_QT-WR9395

There are litterally thousands of cells with similar text but the length of
it and the contect is variable.

What I need from it for cell (A2)...
QT-WR9395.0435

The "QT-WR" is always the same but the "9395" is variable in text and
length. The "." is always there somewhere and the "0435" is variable in text
only.


Is there a way to code something that looks for the QT-WR and grabs that
plus everything after it until the forth caracter after the "."? I tried to
use the Left and Right but I could not figure out how to make it give me the
right info since the text length is not always the same.


Thanks in Advance,
Rob

 
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
Find text and copy elsewhere QPapillon New Users to Excel 7 November 29th 07 08:18 PM
Find and Replace - delete the remainder of the text in the cell after my Find [email protected] Excel Programming 4 August 4th 07 03:39 AM
Find text in a cell and copy text to another cell Shaun Excel Discussion (Misc queries) 6 July 4th 07 05:25 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 text in cell, copy row to new sheet Ajay Excel Discussion (Misc queries) 6 June 29th 05 08:40 AM


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