Just a complete guess. Maybe your cells don't contain spaces. If you've copied
and pasted from a web page, maybe it's those non-breaking spaces (in HTML
speak).
Chip Pearson has a nice addin that can help you determine each character in a
cell:
http://www.cpearson.com/excel/CellView.htm
If it turns out that you have spaces (or those non-breaking spaces), David
McRitchie has some code that will help clean this junk up:
http://www.mvps.org/dmcritchie/excel/join.htm#trimall
(look for "Sub Trimall()")
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
====
If it's none of this stuff, you may want to post more details--samples of what
you're looking for and samples of what the cells contain.
reddog9069 wrote:
basically i am searching cells for a string of text.
Some of the cells have spaces before the string and some of them have 2
or 3 spaces between seperate words in the cell so it is hard to compare
for equality.
I cannot seem to get the Split() method to work when there is leading
whitespace.
It seems to work fine otherwise.
Also I cannot get Trim() to work. No idea why.
May be I need to include some more references, but it is confusing me
greatly.
I am using office 2003 if that helps.
Any help would be greatly appreciated.
--
reddog9069
------------------------------------------------------------------------
reddog9069's Profile: http://www.excelforum.com/member.php...o&userid=24458
View this thread: http://www.excelforum.com/showthread...hreadid=380546
--
Dave Peterson