I am copying a worksheet that has formulas in some ranges to a new workbook. The formulas are VLOOKUPS that reference another worksheet in the source workbook. When I look at the formula in the new workbook (the destination workbook) it has embedded in the
formula the path to the source workbook.
The name of my source workbook is DP_Data_Capture.xls
Its full path is 'C:\Projects\DP_Data_Capture\development[DP_Data_Capture.xls
This is my copy worksheet statement...
ws.Copy After:=Workbooks(wbdestination.Name).Sheets(wbdestination.Sheets.Count)
where ws is my source worksheet and wbdestination is my destination workbook
This is an example of the formula in the source worksheet...
=IF(AP14="","",VLOOKUP(AP14,CostCtr!$B$1:$N$4236,13,FALSE))
CostCtr is a worksheet in the source workbook, I also copied it to the destination workbook.
when I look at the formula in the destination workbook it has the path to the source workbook in it...
=IF(AP14="","",VLOOKUP(AP14,'C:\Projects\DP_Data_Capture\development[DP_Data_Capture.xls]CostCtr'!$B$1:$N$4236,13,FALSE))
I need it to look like this...
=IF(AP14="","",VLOOKUP(AP14,CostCtr!$B$1:$N$4236,13,FALSE))
exactly like the original
Any help is greatly appreciated!
Thanks