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: 20
Default Further Array Element question

I'm working with 2 arrays:
varr ... which holds a range value representing the 1st
cell in a Collection page that a page number
can be placed.
and
varrPageNr ... which holds all the page numbers in the
sheet, but not the Collection page numbers.

Ubound(varr) holds the 1st Collection page, not LBound.
Page numbers must paste with a blank row between them ..... max 20 page
numbers per Collection page.

With help ... here's the code after both arrays have been
successfully populated (as best I can tell at this early stage):

Dim k As Long, l As Long, m As Long, rng As Range

For j = UBound(varr) To LBound(varr) Step -1
Debug.Print j & ": " & varr(j)
' set rng to first cell to hold value
Set rng = varr(j)
k = -1: l = 0
For m = LBound(varrPageNr) To UBound _
(varrPageNr)
k = k + 2: l = l + 1
rng(k).Value = "Page " & varrPageNr(m)
If l = 20 Then Exit For
Next

Next j

I'm trying to take the 1st 20 values in varrPageNr
and paste them into UBound(varr), then take the next
20 values into UBound(varr -1) etc. etc.

My adaptation seems to paste the same 1st 20 values into
the 2nd Collection page.

How to move to the 21st value in varrPageNr as the
routine goes into the 2nd For....Next cycle, please?




 
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
Counting Array element asingh Excel Worksheet Functions 4 April 12th 10 03:30 PM
Permutations of an array element < to a value Bruce Excel Worksheet Functions 3 January 31st 06 04:00 PM
Array Element question S G Booth Excel Programming 5 February 23rd 05 09:59 PM
Array element Andrea[_8_] Excel Programming 5 December 7th 04 08:24 PM
deleting array element michael Excel Programming 0 December 18th 03 08:55 PM


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