View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ajit Ajit is offline
external usenet poster
 
Posts: 64
Default Find & Replace : Keep the original format

I am trying use replace in a worksheet through the below code.

Cells.Replace What:="ABC", Replacement:="DEF", LookAt:=xlPart,
SearchOrder
:=xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True


The problem is that when replace is done the formatting of the cell becomes
same as of the first character.

example if I have text in a cell with following formatting
(Part 1 - Black regular) (Part 2 - Red Italics) (Part 3 - Black Regular)

when i do replace it changes the whole cell to black regular. Is there a way
to do replace with keeping the original formatting.
--
Ajit