View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Hcoms Hcoms is offline
external usenet poster
 
Posts: 6
Default Using VB to search for a value within one column

Hello,

How can you search for a value in a sheet while only looking in one column?
I use the below code to use the find feature but it searches all cols.

ws.Cells.Find(What:="*" & ExcelSearch & "*", After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate

I wish to search and then display all sheets that have a value in it ( i.e.
test) I have done the code for looping through a number of workbooks and
then all the worksheets . However what is the best way to check for a value
in a sheet. Is it the code above? And if so how do you prevent the search
finding the values more than once? I presently compare row numbers , i.e. if
the last row where the value was found is greater or equal to the new found
value then it must be starting at the top of the page again.

Any help would be appreicated!!!