Are you aware that Find (either from Excel's Edit/Find on the menu bar or
the
VB function) will work with wild cards? Let's say you wanted to find
"some text" and that the text you are searching has this in one of your
cells...
This cell contains some //,,.:: text in it.
You can look for "some*text" and it will find the cell with the above text
in it. Now, of course, because it is a wild card search, it will also find
something like this...
This is some of the text in the file
If you are looking for the two words "some" and "text" next to each other
with nothing between them (except possibly punctuation marks), then, in
code, you can do something like this...
Dim FoundCell As Range
Set FoundCell = ActiveSheet.UsedRange.Find("some*text")
If Not FoundCell Is Nothing Then
If FoundCell.Value Like "*some*[A-Za-z0-9]*text*" Then
MsgBox """some text"" does not exist together"
Else
MsgBox "I found ""some text"""
End If
End If
You can, of course, expand this as necessary to find all cells and then do
whatever you are going to do with them (if you are doing this and need help
with it, explain what you need to do with the found cells).
--
Rick (MVP - Excel)
"Noob McKnownowt" wrote in
message ...
Hi once again people,
I am having problems getting a search feature to work in excel. At present
it just matchs the exact strings passed into it, i know about the 'option
compare text' statement so it recognises lower and uppercase letters.
The problem is this, the info being searched is dragged off a mainframe
and
then formated once imported to excel via a macro, this presents a problem
because large amounts of data are being moved at once it is very difficult
to
remove unwanted characters.
Is there a way to build in a feature to my cade that would ignore misc
characters such as,
spaces
.
,
/
\
;
:
If these can be ignored and just the text itself in each cell is searched
this would be a massive advantage, can anyone help???
PLEASE HELP ME!!
The Noob.