View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default search within string

=LEN(SUBSTITUTE(SUBSTITUTE(A2,"-","")," ",""))=0

If TRUE it only contains those characters

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dave B" wrote in message
oups.com...
I'd like to see if a cell contains only "-" and " " (space) characters.
So I'd like to identify " -----" or " - - - - ", but not " --a- ".
I figure I could look one character at a time for something other than
" " or "-". But this seems tedious. Is there an easier way? Thanks.