Share via

Copy formulas To different workbook without reference to source workbook

Anonymous
2012-04-05T03:42:31+00:00

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

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2012-04-05T03:57:21+00:00

    As a follow up I see if you go into Menu EDIT..LINKS and select CHANGE STATUS you can remove the link.

    However is there a way to do this using vba during the copy process.

    I really don't want the users having to do this.

    Thanks

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments