In my workbook, I have formulas on Sheet 2 that refences values on Sheet1. When I want to issue updates, my plan is to have an update button that among other things is to copy data from the wbUserCopy to the UpdatedWB. That process looks like this:
This all works as I want it to except for the formulas mentioned above. The formula carries the originating workbook name with it, thus creating an external link as shown here:
='[UserCopy.xlsm]User Input'!$B$3
I want to keep that as:
='User Input'!$B$3
I can certainly find "[UserCopy.xlsm]" and replace with nothing. But is there a better way, like a different way to copy the sheet?
VBA Code:
If Not sheetExist(sSheet, wbNewVersion) > 0 Then 'sheetExist is a function
wbUserCopy.Sheets(sSheet).Copy Before:=UpdatedWB.Sheets("Sheets1")
If sheetExist(sSheet, UpdatedWB) > 0 Then
'log success/failures
End If
This all works as I want it to except for the formulas mentioned above. The formula carries the originating workbook name with it, thus creating an external link as shown here:
='[UserCopy.xlsm]User Input'!$B$3
I want to keep that as:
='User Input'!$B$3
I can certainly find "[UserCopy.xlsm]" and replace with nothing. But is there a better way, like a different way to copy the sheet?