PDA

View Full Version : Find and Replace not working



Cortex
03-03-2020, 02:18 PM
Hello all,

I have a problem with a simple VBA macro using .Replace

what i need to do its to add a "=" at the begining of all "value" matching "SI(" to transfotm it to "=SI("

[SI(APPSHEET!B2="";"";APPSHEET!A1)] => =SI(APPSHEET!A1="";"";APPSHEET!A1)

My workbook is an input template for another application Its like i have a sleeping formula that i want to activate after returning a first batch of processing done in a cloud app


Here an extract of the macro :
Sub COPY_VALUE_SI()

Sheets("APD FTTA").Select

Cells.Replace what:="SI(", Replacement:="=SI(", LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False




End Sub

For some reason, its not working.



But Its working just fine if i use this one

Cells.Replace what:="APPSHEET!A1", Replacement:="=APPSHEET!A1", LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False




Can some of you help me ?