Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Would like to copy all the Ranged Names starting with "VBA" to a new workbook. 1. Syntax jams on : Range(nme.Name).Copy '''''GRRRRRRR''''''' 2. I do not create a new workbook for every name I am exporting do I? Sige Sub sige() Dim ThisBook As Workbook Dim ExpBook As Workbook Dim nme As Name Set ThisBook = ActiveWorkbook Set ExpBook = Workbooks.Add(xlWorksheet) For Each nme In ThisBook.Names If Left(nme.Name, 3) = "VBA" Then MsgBox nme.Name Range(nme.Name).Copy '''''GRRRRRRR''''''' With ExpBook .Worksheets(1).Range(Range(nme.Name).Address).Past e .SaveAs FileName:=ThisWorkbook.Path & "\temp.xls", _ FileFormat:=xlWorkbook .Close SaveChanges:=False If Err < 0 Then MsgBox "Cannot export" & _ ThisWorkbook.Path & "\temp.xls" End With Else MsgBox "No names to export" Exit Sub End If Next nme End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA Copy Paste Issue | Excel Discussion (Misc queries) | |||
Copy & Paste Issue | Excel Discussion (Misc queries) | |||
Copy Paste issue | Excel Worksheet Functions | |||
Copy Chart issue | Charts and Charting in Excel | |||
Issue with copy & paste? | Excel Discussion (Misc queries) |