A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
It looks like you're trying to use worksheet functions in VBA. SUBSTITUTE, for example, is not a VBA function, and while Replace and Find are available in VBA, their syntax is different than that of the worksheet functions REPLACE and FIND.
If you want to use the worksheet functions in VBA, you can prefix them with Application.WorksheetFunction, e.g. Application.WorksheetFunction.Replace(...) or Application.WorksheetFunction.Substitute(...)