the following code works:
Dim strNew As String
strNew = "xxyy"
strNew = Replace (strNew, "y", "z")
But this one doesn't, i get a syntax error:
Dim strNew As String
strNew = "xxyy"
strNew = Replace expression:=strNew, find:="y", replace:="z"
This is the description of the Replace Function (part of vba.strings) according to "help" (F2):
Function Replace(Expression As String, Find As String, Replace As String, [Start As Long = 1], [Count As Long = -1], [Compare As VbCompareMethod = vbBinaryCompare]) As String
Element von VBA.Strings
Find and replace a substring within a string
I don't understandy why there is an error?