ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Breaking a link. (https://www.excelbanter.com/excel-programming/344825-breaking-link.html)

Richard Buttrey

Breaking a link.
 
Hi,

I copy a range of cells from one Wb to another.

The range copied from has some cells which are dependent on a variable
stored elsewhere.

e.g. the variable name "Year" is 2005, and one of the cells in the
copied range says =Year


I then paste the copied range into another workbook. At that stage the
second wb still has the =Year cell with presumably a link back to the
first Wb.

In the 2nd Wb I then Edit and Copy PasteSpecial the range of cells
containing the =Year. This correctly changes the formula to a value.

I had expected the PasteSpecial to break the link, but apparently not.
if I look in the Insert Names Define box in the second Wb, I still
find a reference to the =Year name, pointing back to the first Wb, and
of course when I close and open 2nd Wb I get the usual question about
links

Is this the way Excel is supposed to operate?

What's the best way of avoiding these links carrying across?
I suppose I could use some Workbook.BreakLinks code, but that seems a
bit heavy, and I'd have to code all the link names.

Any ideas??

TIA



__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________

Don Guillett[_4_]

Breaking a link.
 
Have you tried deleting the name
insertnamesdefinebring up the namedelete

--
Don Guillett
SalesAid Software

"Richard Buttrey" wrote in
message ...
Hi,

I copy a range of cells from one Wb to another.

The range copied from has some cells which are dependent on a variable
stored elsewhere.

e.g. the variable name "Year" is 2005, and one of the cells in the
copied range says =Year


I then paste the copied range into another workbook. At that stage the
second wb still has the =Year cell with presumably a link back to the
first Wb.

In the 2nd Wb I then Edit and Copy PasteSpecial the range of cells
containing the =Year. This correctly changes the formula to a value.

I had expected the PasteSpecial to break the link, but apparently not.
if I look in the Insert Names Define box in the second Wb, I still
find a reference to the =Year name, pointing back to the first Wb, and
of course when I close and open 2nd Wb I get the usual question about
links

Is this the way Excel is supposed to operate?

What's the best way of avoiding these links carrying across?
I suppose I could use some Workbook.BreakLinks code, but that seems a
bit heavy, and I'd have to code all the link names.

Any ideas??

TIA



__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________





All times are GMT +1. The time now is 05:40 PM.

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