View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
McCloudK McCloudK is offline
external usenet poster
 
Posts: 7
Default Using a cell reference within a macro to find and replace

I currently use the following within a macro:

Range("B7:B100").Select
Application.ReplaceFormat.Interior.ColorIndex = 3
Selection.Replace What:="sutherland", Replacement:="Sutherland",
LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=True

I am not sure if this is the best way to accomplish what I need....but it
works. It looks for sutherland, finds it, and basicly shades the cell with
colorindex=3. Question is....Can I somehow substitute a cell reference in the
What:="xxx" area. I would like the macro to search the range for a match to a
specific cell and then replace with that cells value and color code the cell.

Thanks,

Ken