copying named cells into new workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to copy and paste named cells from one workbook to another
without having the origin file name pasting in as well? So if i'm pasting a
cell named XYZfrom One.xls into Two.xls will Two.xls have a cell called
One.xls!XYZ ? It is important that the Two.xls workbook have absolutely no
reference to One.xls. Also, how do I keep the message that asks if I want to
keep the cell name from popping up when I'm pasting into Two.xls?
 
Did you check the name in Two.xls using Insert | Name > Define...?
What was the name? Was it One.xls!XYZ?

If you are using the GUI, the warning you refer to cannot be
suppressed. If you are using code, use the DisplayAlerts property as
in:

Sub testIt()
Application.DisplayAlerts = False
Workbooks("book1").Worksheets("sheet1").Range("C11:E20").Copy _
Workbooks("Book2").Worksheets("sheet1").Range("C11")
Application.DisplayAlerts = True
End Sub

Book1 Sheet1 C11:C20 was named aName. Running the above code twice
generates the warning *if* the first line is commented out.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
Back
Top