Sub replaceformula()
OldFile = "OldFile"
NewFile = "NewFile"
OldSheetName = "OldSheet"
NewSheetName = "NewSheet"
Set ReplaceRange = Range("A1:G7")
ReplaceRange.Replace What:=OldFile, _
Replacement:=NewFile, _
SearchOrder:=xlByColumns, _
MatchCase:=True
ReplaceRange.Replace What:=OldSheetName, _
Replacement:=NewSheetName, _
SearchOrder:=xlByColumns, _
MatchCase:=True
End Sub
"Padrager" wrote:
> I need to create a macro that will update the file name and worksheet (tab)
> references for all formulas within a range. I already have set up form drop
> down boxes for the users to select the file and worksheet reference. I need
> the VBA coding that will capture the users inputs and complete a find/replace
> on all of the formulas for file name/worksheet. Would anyone provide the code
> or point me in the direction of where this has been discussed previously?
> Much Thanks!!!!
|