I am trying to use find and replace to replace one formula with another. When I use my code with words in the string it works:
Sub new()
Cells.Replace What:="Hej", _
Replacement:="Farvel", LookAt:=xlWhole, SearchOrder:= _
xlByColumns, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
End Sub
But when I use it with formulas in the string it won't work:
Sub new()
Cells.Replace What:="=LOPSLAG(C$4;'Kalender skjult'!$A$1:$H$5000;7;FALSK)", _
Replacement:="=HVIS($C$18>0;1;0)", LookAt:=xlWhole, SearchOrder:= _
xlByColumns, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
End Sub
It's in Danish. Hope someone can tell me why it won't work with formulas
Sub new()
Cells.Replace What:="Hej", _
Replacement:="Farvel", LookAt:=xlWhole, SearchOrder:= _
xlByColumns, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
End Sub
But when I use it with formulas in the string it won't work:
Sub new()
Cells.Replace What:="=LOPSLAG(C$4;'Kalender skjult'!$A$1:$H$5000;7;FALSK)", _
Replacement:="=HVIS($C$18>0;1;0)", LookAt:=xlWhole, SearchOrder:= _
xlByColumns, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
End Sub
It's in Danish. Hope someone can tell me why it won't work with formulas