Try this for the selection
It will add a workbook and copy your selection in the first sheet in the same cells
Sub test()
Dim destrange As Range
Dim myarea As Range
Dim wb As Workbook
Dim newwb As Workbook
Set wb = ActiveWorkbook
Set newwb = Workbooks.Add
Set destrange = newwb.Sheets(1).Cells(1)
wb.Activate
Application.ScreenUpdating = False
For Each myarea In Selection.Areas
With myarea
.Copy Destination:=newwb.Sheets(1).Range(.Address)
End With
Next myarea
Application.ScreenUpdating = True
End Sub
--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl
"brym" wrote in message ...
It looks almost as that's what I need except that I need to perform the copy
to another workbook, not to a new sheet in the old wb. It's a must that the
old wb remains unchanged. I just can't make it work with a new wb, but then
again, I guess im too tired to be smart.
I'd be very pleased if you have a solution to this. Otherwise I'll get into
the matter in the morning and so far, thanks for your help, Ron.
Kind regards Birger
"brym" skrev i en meddelelse
...
I have a spreadsheet with person-names in Col A. The user may freely
create
ranges to show different combinations of users and the ranges exists only
as
Named Ranges.
Once i a while I'll have to copy the person-names and range names to a new
workbook (a new period of time).
Could anyone please tell me how to transfer all existing ranges from one
workbook to another using VBA or which approach to use?
Thanks in advance