View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] phil.emmott@baesystems.com is offline
external usenet poster
 
Posts: 2
Default Loop through range of cells, string search, take action

Hi there

I'm pretty new to this vba stuff, so hopefully this is not a difficult
request!

I'm after a code snippet that will loop through a range of cells - say
E2:H40 looking for strings in cells. In this case I'm looking for bits
of addresses. if any of the cells in that range on any particular row
contain "Preston" or "PR2 4JK" i'd like the macro to then put "1772" in
the 'I' cell on that row.

the cells may contain more characters than the "Preston", so as long as
the cell contains that string, the if/case statement should be true.

Thanks