I want to completely replace a sheet in my current spreadsheet from an identically named sheet from a master spreadsheet (macro within a button).
The sheets of the target sheets contain named ranges. The sheets of the master also contain these same named ranges.
I'm using this code:
Sub TestingUpdate()
'
' TestingUpdate Macro
'
'
Workbooks.Open Filename:= _
"\\server1\company\Products\Lift Tables\Engineering\Lift Table configurator- Jon's project\Development\testing updating\LiftMate.xlsm"
'LIFT TABLE DATA complete copy
Windows("LiftMate.xlsm").Activate 'added
Sheets("LIFT TABLE DATA").Select
Cells.Select
Application.CutCopyMode = False 'added
Selection.Copy
Windows("LiftMate-Quote.xlsm").Activate
Sheets("LIFT TABLE DATA").Select
Cells.Select
ActiveSheet.Paste
End Sub
I want to copy the sheets and the named range definitions from the master into the target.
When VB does the copying the following message comes up for every named range:
"A formula or sheet you want to move or copy contains the name 'ENTTABLE', which already exists in the destination worksheet. Do you want to use this version of the name?"
I want the VB script to automaticially say "yes" to this question everytime.
Bookmarks