View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.newusers
meiftan meiftan is offline
external usenet poster
 
Posts: 6
Default IF cells(row,column) contain "this word" ??? Then return text

Hi,
I'm a new user working on a database using excel, and I want to make a
search feature.
example, some cells contain "Mark Sungkar" , "Mark Hopeless" , "Mark And
Friends"

this code doesn't work :
x = Sheets("database").Cells(Rows.Count, "B").End(xlUp).Row

For z = 2 To x
If Sheets("database").Cells(z, 2) = "Mark" Then
'return the cell contains "Mark" with his full name
end if
Next z

the "x" counts cells contain data
Thank You for any help
Regards,