Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default loop through all named ranges

I have a set of named ranges in a worksheet that are spread out
through the sheet. I need to loop through the ranges, with the
intention of copy the values and pasting them in another workbook.

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default loop through all named ranges

Dim rng as Range
Dim nm as Name
for each nm in Thisworkbook.Names
set rng = nothing
on Error Resume Next
set rng = nm.RefersToRange
On error goto 0
rng.copy Destination:=workbooks("New.xls"). _
Worksheets(1).Cells(rows.count,1).end(xlup)(2)
Next

--
Regards,
Tom Ogilvy


"Bert" wrote in message
om...
I have a set of named ranges in a worksheet that are spread out
through the sheet. I need to loop through the ranges, with the
intention of copy the values and pasting them in another workbook.

Any suggestions?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default loop through all named ranges

Tom,
What does the (2) do on the next to last line of your code?
Thanks,
JMay

"Tom Ogilvy" wrote in message
...
Dim rng as Range
Dim nm as Name
for each nm in Thisworkbook.Names
set rng = nothing
on Error Resume Next
set rng = nm.RefersToRange
On error goto 0
rng.copy Destination:=workbooks("New.xls"). _
Worksheets(1).Cells(rows.count,1).end(xlup)(2)
Next

--
Regards,
Tom Ogilvy


"Bert" wrote in message
om...
I have a set of named ranges in a worksheet that are spread out
through the sheet. I need to loop through the ranges, with the
intention of copy the values and pasting them in another workbook.

Any suggestions?





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default loop through all named ranges

if offsets to the next cell below.

--
Regards,
Tom Ogilvy

"JMay" wrote in message
news:roWAc.2805$HN5.1380@lakeread06...
Tom,
What does the (2) do on the next to last line of your code?
Thanks,
JMay

"Tom Ogilvy" wrote in message
...
Dim rng as Range
Dim nm as Name
for each nm in Thisworkbook.Names
set rng = nothing
on Error Resume Next
set rng = nm.RefersToRange
On error goto 0
rng.copy Destination:=workbooks("New.xls"). _
Worksheets(1).Cells(rows.count,1).end(xlup)(2)
Next

--
Regards,
Tom Ogilvy


"Bert" wrote in message
om...
I have a set of named ranges in a worksheet that are spread out
through the sheet. I need to loop through the ranges, with the
intention of copy the values and pasting them in another workbook.

Any suggestions?







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default loop through all named ranges

Thanks Tom;

"Tom Ogilvy" wrote in message
...
if offsets to the next cell below.

--
Regards,
Tom Ogilvy

"JMay" wrote in message
news:roWAc.2805$HN5.1380@lakeread06...
Tom,
What does the (2) do on the next to last line of your code?
Thanks,
JMay

"Tom Ogilvy" wrote in message
...
Dim rng as Range
Dim nm as Name
for each nm in Thisworkbook.Names
set rng = nothing
on Error Resume Next
set rng = nm.RefersToRange
On error goto 0
rng.copy Destination:=workbooks("New.xls"). _
Worksheets(1).Cells(rows.count,1).end(xlup)(2)
Next

--
Regards,
Tom Ogilvy


"Bert" wrote in message
om...
I have a set of named ranges in a worksheet that are spread out
through the sheet. I need to loop through the ranges, with the
intention of copy the values and pasting them in another workbook.

Any suggestions?








Reply
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
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
named ranges - changing ranges with month selected gr8guy Excel Programming 2 May 28th 04 04:50 AM
Excel VBA - loop columns named AA, AB..etc Tobias[_2_] Excel Programming 3 April 19th 04 01:26 PM
Loop through ranges hotherps[_30_] Excel Programming 3 February 29th 04 08:35 AM
loop to name ranges spence[_3_] Excel Programming 1 January 8th 04 05:16 PM


All times are GMT +1. The time now is 11:09 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"