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: 852
Default Post my named ranges in column A

GEN, COMM, MAJ etc. are dynamic named ranges on sheet 1, Workbook in scope.
Refers To formula looks like this:

=OFFSET(Sheet1!$T$2,0,0,COUNTA(Sheet1!$T$2:$T$50), 1)

Each range has a header and four entries for testing but when working each will be a different number of rows.

I need them to list each range in column A starting at A2 and a one row space between each range.

The code here lists only the header of each named range in column A and no space between them.

I tried to put a Resize in the posting line but that did not work either, I just used 5 rows by 1 column but it too just posted the headers.

The commented out line did nothing.

I cannot remember the step I am missing to post the entire named range instead of just the header.

Thanks.
Howard



Sub RankArray()

Dim Rank_array(9)
Dim i As Long

Rank_array(0) = Range("GEN")
Rank_array(1) = Range("COMM")
Rank_array(2) = Range("MAJ")
Rank_array(3) = Range("CPT")
Rank_array(4) = Range("LT")
Rank_array(5) = Range("MSGT")
Rank_array(6) = Range("SGT")
Rank_array(7) = Range("CPL")
Rank_array(8) = Range("PVT")

For i = LBound(Rank_array) To UBound(Rank_array)
Range("A" & Rows.Count).End(xlUp)(2) = Rank_array(i)

'Range("A" & Cells(Rows.Count, "A").End(xlUp).Row) _
.End(xlUp)(2).Value = Rank_array(i)

Next 'i

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
Create named ranges in Column on worksheet eholz1 Excel Programming 0 January 24th 08 01:41 AM
Named ranges scope / workbook/worksheet level named ranges- changeswith variable use... christian_spaceman Excel Programming 3 December 24th 07 01:15 PM
Multiple Named Ranges in the Same Column David Excel Worksheet Functions 2 May 9th 07 12:48 AM
Comparing Named ranges apologies for the dodgey post below Sam Crump Excel Worksheet Functions 5 March 7th 06 12:52 PM
Named ranges - column/row question Carole O Excel Discussion (Misc queries) 5 May 11th 05 02:40 PM


All times are GMT +1. The time now is 06:39 PM.

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

About Us

"It's about Microsoft Excel"