View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
DMoney DMoney is offline
external usenet poster
 
Posts: 130
Default Searching a cell for certain contents

Columns("B:B").Select
Selection.Find(What:="hat", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate



"Derek Johansen" wrote:

I would like to check to see if a cell contains a certain string within the
whole cell. For example, if column B has a lot of data, and one of the
entries is "The cat in the hat" I would like a macro to search column B for
the word hat. I don't care what happens when it finds it at the moment, as I
believe i can establish that myself, I just need a command to search within a
cell for a certain word. I've tried using the InStr command a bit, but to no
avail!

Any help would be much appreciated! Thanks!