Microsoft Excel Popup Box automatically having it select yes

zoog25

Active Member
Joined
Nov 21, 2011
Messages
418
Hello All,

Here is my situation. I have a program that I'm working on that transfers sheets from one workbook to another. Now every time it runs I get a popup message asking the following:
A formula or sheet you want to move or copay contains the name "TBDeveloper", 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.

Now the thing is that i don't want to message box to popup because the answer will always be "Yes". How do i prevent / have the program automatically answer yes to this question.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi zoog25. Trial moving the sheet using a collection. Something like this...
Code:
Dim FSO As Object, FilDir As Object, ShtCollect As Collection
Set FSO = CreateObject("Scripting.FilesystemObject")
'***adjust file path to suit
Set FilDir = FSO.getfile("C:\yourfoldername\filename.xlsm")
Application.DisplayAlerts = False
Workbooks.Open Filename:=FilDir
'load sheet in collection
Set ShtCollect = New Collection
ShtCollect.Add Workbooks(FilDir.Name).Sheets("Sheet1")
ShtCollect(1).Copy ThisWorkbook.Sheets(1)
Adjust the file path and sheet name to suit. HTH. Dave
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,497
Members
448,967
Latest member
visheshkotha

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