Auto-Handling of Named Range Existing in Destination Worksheet w/ VBA

bonzo

Board Regular
Joined
Oct 23, 2002
Messages
79
I'm using "WS.Cells(TempRow,TempCol).PasteSpecial Paste:=xlPasteValidation" in a VBA macro to paste copied cells from another workbook. As a result, I get the following popup window:

==============
A formula or sheet you want to move or copy contains the name "MY_MENU", which already exists on the destination worksheet. Do you want to use this version of the name?
* To use the name as defined in the destination sheet, click Yes.
* To rename the range referred to in the formula or worksheet, click No, and enter a new name in the Name Conflict dialog box.
==============

I'm looking for a way to auto-handle this situation such that the "Yes" selection would be done without prompting the user for the choice. Is there a way to do this?

Thanks,

Bonzo
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try adding this before the paste line:
Application.DisplayAlerts = False
 
Upvote 0

Forum statistics

Threads
1,203,464
Messages
6,055,573
Members
444,799
Latest member
CraigCrowhurst

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top