how can i find cells which contain certain text?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

example, in certain column, need to find all records which contain M.D. or MD
or M.D, etc
 
You could use Conditional Formatting to highlight these cells.

Select your Column
From the Format Menu, choose "Conditional Formatting..."
Change "Cell Value Is" to "Formula Is"
Enter the formula: =FIND("MD",SUBSTITUTE(A1,".",""))
Set your format (red background perhaps?)
Click OK

That should do it.

HTH,
Elkar
 
try this where your column is col b in sheet2
Sub findmd()
myword = Array("MD", "M.D")
For Each cel In myword
With Worksheets(2).Columns(2)
Set c = .Find(cel, LookIn:=xlValues, lookat:=xlPart)
If Not c Is Nothing Then
firstAddress = c.Address
Do
MsgBox c.Address
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Next cel
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top