View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nicawette Nicawette is offline
external usenet poster
 
Posts: 27
Default cell.replace strange behaviour

Hi all,

Sub remplacement()
Sheets("Sheet2").Select
Cells.Replace What:="=", replacement:="=", LookAt:=xlPart,
SearchOrder _
:=xlByRows, MatchCase:=False
Sheets("Sheet3").Select
Cells.Replace What:="=", replacement:="=", LookAt:=xlPart,
SearchOrder _
:=xlByRows, MatchCase:=False
End Sub

I've recorded this macro to avoid hitting enter each time when I copy a
formula located in a cell in text format into a new cell (not in text
format).

When I run this macro it works fine with a formula like "=x+5" or
"=len()" but not with a formula like "=vlookup()" I have an error 1004
message saying that "replace method of range class failed".

The amazing thing is that when I have recorded this macro, it worked
fine with the =vlookup() and also worked fine when I've used the find
and replace ????

Any idea to solve it ?

Tx

Nic.