LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Copy Different Name References to New Workbook

Hi There,

I have created through VBA a couple of Names:
eg:
VBA1 = Sheet1!$B$1:$B$5
VBA2 = Sheet1!$C$10:$C$50
etc ...
-I do not see the light anymore in all the sample codes i found!!!-

Is there a way to copy all the ranges of my Names beginning with "VBA"
to a new workbook
(NOT the Names of the ranges (eg. VBA1)
nor the address (eg. Sheet1!$B$1:$B$5)
but the content in cells B1:B5 and C10:C50 and ... like Copy= Paste
Special

A bit like: ...
Application.Goto Reference:="VBA1"
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues
Selection.PasteSpecial Paste:=xlFormats
Application.Goto Reference:="VBA2"
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues
Selection.PasteSpecial Paste:=xlFormats
But looping ... so that each Name reference gets copied into the new
workbook, putting them on the same worksheet next to each other???

Looking like this in the new workbook:
A B ...
1 B1 C10
2 B2 C11
3 ... ...

Best Regards, Sige

Sub ListVBARangeNames()'Will display the Names in my workbook starting
with "VBA"
Dim RN As Object
Dim listrn As String

For Each RN In ActiveWorkbook.Names
If RN.Name Like "VBA*" Then
listrn = listrn & vbCr & RN.Name
End If
Next RN
MsgBox listrn
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
workbook references Russell Hampton Excel Worksheet Functions 2 November 26th 08 07:06 PM
how do I copy R[40]C1 references Peter Excel Worksheet Functions 0 August 17th 06 03:50 PM
Worksheet.copy changes references Marco[_4_] Excel Programming 2 February 15th 05 02:38 AM
Workbook references Murray Williams[_3_] Excel Programming 2 October 31st 03 09:26 PM
Question for Experts: Opening workbook with workbook references Chris Excel Programming 0 September 11th 03 07:05 PM


All times are GMT +1. The time now is 08:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"