On Thu, 29 Mar 2007 09:56:27 +0100, "Roger Govier"
<(E-Mail Removed)> wrote:
>Hi Jim
>
>If you used 3 "spare" non printable columns at the start of you report,
>you could have the following :-
>In column A, in the first 10 rows only, enter the Column number you
>wish to pick up on each of your 10 pages
>In column B, in the first 66 row only, leave blank so you can enter the
>row number of the Item you wish to pick up
>In the rest of column B, in B67 enter = B1 and copy down to B132.
>Repeat this pattern for the remaining 8 "pages"
>In column C in
>C1 enter =$A$1
>in C2 enter = C1 and copy down to C66
>In C67 enter =$B$1 and in C68 enter = C66 and copy down to C132
>Repeat pattern for your other "pages"
>
>In D1, your formula now is simply
>=IF(OR(B1="",C1=""),"",INDEX(D!$1:$10000,B1,C1))
>copy down through D2
660
>This is a one off exercise which sets up your template.
>
>Now, all you have to do to run your report, is to enter the 10 column
>numbers in A1:A10, and they need not be contiguous and then enter the
>item numbers in B1:B66.
>There is no need to amend any formulae.
>The If / Or part of the formula means that you can leave blanks in your
>list to space items out, or not bother to populate all 66 rows of a page
>if you don't want to without creating a series of zeros.
>
>Compared with Offset, you should find this runs considerably quicker.
>Increase or decrease the number of rows 1:10000 to suit the size of your
>data in sheet D.
I think I see how it would be faster than offset, but I'm at a loss to
understand how it accomplishes my goal of being able to insert a row
into the D worksheet without causing the references in the R worksheet
to stop working.
Instead of using the row number in B, perhaps I would expand it to the
MATCH() value I came up with? Then, my formula in the cell would be:
=INDEX(D!$1:$10000,MATCH(B1,D!$A$1

!$A$4000,0),C1)
Since all my output is formatted, I never have need for the IF=""
stuff.
Now, remember that I said this was more like a word mail merge than a
listing. Hence, there are some "rows" in the printing part of the
worksheet that have cells that have formulas in them which format
multiple items from the D worksheet. Not to mention some rows which
have multiple cells on them each picking up information from different
rows of the D worksheet. Think:
F10:="The " & Offset(D!$A$1,MATCH(13,D!$A$1:$A$4000,0)-1,$A10-1,1,1) &
" in " & Offset(D!$A$1,MATCH(14,D!$A$1:$A$4000,0)-1,$A10-1,1,1) & "
falls mainly on the " &
Offset(D!$A$1,MATCH(15,D!$A$1:$A$4000,0)-1,$A10-1,1,1) & "!"
where
the match to 13 has: "rain"; 14 has: "Spain" and 15 has "plain"
would yield:
The rain in Spain falls mainly on the plain!
I think I could extend your concept by expanding column B by, let's
say, 4 columns, so the columns B through F have match references and G
has your C and my print area starts at H. In this way I would be
limited to using no more than 5 "matches" on any one row of the
output.
Nice idea. It would make everything an index, rather than an offset.
For example, assuming I had 13 in my B, 14 in my C, 15 in my D, the
above would be:
M10:="The " & INDEX(D!$1:$10000,MATCH(B10,D!$A$1

!$A$4000,0),G10) & "
in " & INDEX(D!$1:$10000,MATCH(C10,D!$A$1

!$A$4000,0),G10) & " falls
mainly on the " & INDEX(D!$1:$10000,MATCH(D10,D!$A$1

!$A$4000,0),G10)
& "!"
Is Index that much faster than Offset?
Thanks again.
Jim