ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing formulae links (https://www.excelbanter.com/excel-programming/370329-changing-formulae-links.html)

[email protected]

Changing formulae links
 
I am copying formulae from an old version of a template, into a newer
one, using a macro. Unfortunately, when the macro copies over the
formulae, it references them to cells in the old worksheet, not the new
one. I know I could use :

ActiveCell.ChangeLink Name:= _
"old template", NewName:= _
"current/new template", Type:=xlExcelLinks

But the problem with this is that it changes links for the whole
workbook. While I do want to change the links in some cells, I also
want to keep them for others. Is there any VBA code to change links
individually for cells?


Tom Ogilvy

Changing formulae links
 
select the cells, then do Edit=Replace

old link string

new link string

--
Regards,
Tom Ogilvy


" wrote:

I am copying formulae from an old version of a template, into a newer
one, using a macro. Unfortunately, when the macro copies over the
formulae, it references them to cells in the old worksheet, not the new
one. I know I could use :

ActiveCell.ChangeLink Name:= _
"old template", NewName:= _
"current/new template", Type:=xlExcelLinks

But the problem with this is that it changes links for the whole
workbook. While I do want to change the links in some cells, I also
want to keep them for others. Is there any VBA code to change links
individually for cells?




All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com