Error on Range.ReplaceFormat statement Excel VBA

F

FredZimmerman

Sub ReplaceCellContents()

Application.ReplaceFormat.Font.FontStyle = "Bold Italic"

Range("A1:G16").Replace What:="Seattle", Replacement:="San Francisco",
ReplaceFormat:=True

End Sub

When I try to run this VBA macro ReplaceFormat is hilighted, and error
messsage:

Compile error:

Named argument not found.

Comes up. This code was taken straight from Excel Programming text.

Fred Z.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top