ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Named ranges and pasting formulas with named references (https://www.excelbanter.com/excel-programming/418235-named-ranges-pasting-formulas-named-references.html)

Dude3966

Named ranges and pasting formulas with named references
 
I have created a workbook that will copy and paste cells from another
workbook into itself using VBA. In the parent workbook is a range of cells
that are named, one of the formulas that is pasted from else where refers to
this named range. The copy/paste function works fine and the formulas work.
the problem that I have is that every time the formual is copied into the
parent work book a message is desplayed that read:

A formula or sheet you want to move containf the name 'ref', which already
exsts in the destination worksheet. Do yuo want to use this version of the
name?
To use the name as defined in the destination sheet, click Yes.
To rename the range reffered to int he formula or worksheet, click No, and
enter a new name in the Name Conflict dialog box.

i would like to be able to automatically choose Yes.

Is this possible and if so how?

Ken Johnson

Named ranges and pasting formulas with named references
 
On Oct 8, 10:16*pm, Dude3966
wrote:
I have created a workbook that will copy and paste cells from another
workbook into itself using VBA. In the parent workbook is a range of cells
that are named, one of the formulas that is pasted from else where refers to
this named range. The copy/paste function works fine and the formulas work.
the problem that I have is that every time the formual is copied into the
parent work book a message is desplayed that read:

A formula or sheet you want to move containf the name 'ref', which already
exsts in the destination worksheet. Do yuo want to use this version of the
name?
To use the name as defined in the destination sheet, click Yes.
To rename the range reffered to int he formula or worksheet, click No, and
enter a new name in the Name Conflict dialog box.

i would like to be able to automatically choose Yes.

Is this possible and if so how?


Try...

Application.DisplayAlerts = False

before the paste.

Ken Johnson

Dude3966

Named ranges and pasting formulas with named references
 
Ken,

Thanks very much, that answers my question. It works exactly as i wanted.

Chris

"Ken Johnson" wrote:

On Oct 8, 10:16 pm, Dude3966
wrote:
I have created a workbook that will copy and paste cells from another
workbook into itself using VBA. In the parent workbook is a range of cells
that are named, one of the formulas that is pasted from else where refers to
this named range. The copy/paste function works fine and the formulas work.
the problem that I have is that every time the formual is copied into the
parent work book a message is desplayed that read:

A formula or sheet you want to move containf the name 'ref', which already
exsts in the destination worksheet. Do yuo want to use this version of the
name?
To use the name as defined in the destination sheet, click Yes.
To rename the range reffered to int he formula or worksheet, click No, and
enter a new name in the Name Conflict dialog box.

i would like to be able to automatically choose Yes.

Is this possible and if so how?


Try...

Application.DisplayAlerts = False

before the paste.

Ken Johnson



All times are GMT +1. The time now is 01:33 PM.

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