View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ken Johnson Ken Johnson is offline
external usenet poster
 
Posts: 1,073
Default 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