'Replace.bas shows how to use the Edit | Replace function in automation 'to replace a value in the worksheet with another value. '===================================== Sub Main Dim SurferApp As Object Set SurferApp = CreateObject("Surfer.Application") SurferApp.Visible = True 'Open the worksheet document Set Wks = SurferApp.Documents.Open(SurferApp.Path+"\Samples\demogrid.dat") 'Specify the worksheet range Set WksRange = Wks.Columns(Col1:=1, Col2:=2) 'Replace "4" with the text "test" Set After = Wks.Range(1, "A", 1, "A") 'First cell WksRange.Replace(TargetStr:="4", ReplaceStr:="test", Current:=After, Scope:=wksFindScopeEntire, Method:=wksFindPhrase, ReplaceAll:=True) End Sub