ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Name conflict (https://www.excelbanter.com/excel-programming/275520-name-conflict.html)

John Turton

Name conflict
 
I want to copy a range from one workbook to another. Within the range is
a reference to a named range which exists in both workbooks. I want it
to use the name in the destination workbook. At the moment I get an
Excel message saying:

"A formula or sheet you want to move or copy contains the name 'name',
which already exists on the detination worksheet. Do you want to use
this version of the name?"

It gives a choice Yes or No. I don't want this message to appear and I
always want to choose "Yes".

I can't just send an enter keystroke because if there is a different
error such as the ranges being a different size I want to be alterted.

Any suggestions ?
Thanks

Tom Ogilvy

Name conflict
 
If you aren't doing any formula adjustments

Workbooks("Book2.xls").Worksheets("Sheet3").Range( "A1:F32").Formula = _
ThisWorkbook.Worksheets("Sheet1").Range("A1:F32"). Formula

--
Regards,
Tom Ogilvy


"John Turton" wrote in message
...
I want to copy a range from one workbook to another. Within the range is
a reference to a named range which exists in both workbooks. I want it
to use the name in the destination workbook. At the moment I get an
Excel message saying:

"A formula or sheet you want to move or copy contains the name 'name',
which already exists on the detination worksheet. Do you want to use
this version of the name?"

It gives a choice Yes or No. I don't want this message to appear and I
always want to choose "Yes".

I can't just send an enter keystroke because if there is a different
error such as the ranges being a different size I want to be alterted.

Any suggestions ?
Thanks




John Turton[_2_]

Name conflict
 
Thanks - so simple and it works


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

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