Thread: Auto-Hyperlink
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Auto-Hyperlink

"Starguy" wrote
thanks Max it worked well


You're welcome, Starguy !

but this formula is difficult to understand for me.
i'll try to understand it so that i can create it by myself.
have you any explanation regarding such formulas


Here's some explanations ..

One key part within the formula is the
Incrementer expression: ROW(A1)*20-20+5

Try putting the above expression (just add an equal sign in front) in any
starting cell, then copy down. You'll see that it returns: 5, 25, 45, ..
which is exactly the row number series that is wanted.

The part: ROW(A1)*20-20 gives us the required incremental steps of 20 as we
copy down, while the 5 is just a numerical adjustment since we want to start
with row 5.
[ Note that:=ROW(A1) in any cell returns 1, when we copy down it becomes
=ROW(A2) which returns 2, and so on.]

The friendly names expression within the HYPERLINK:

"Sheet2!B"&ROW(A1)*20-20+5

simply joins* the text: "Sheet2!B"
in front of the numbers: 5, 25, 45, ...
to produce: Sheet2!B5, Sheet2!B25, Sheet2!B45, ...
in the copy down

*i.e. concatenates

In the 2nd version, we used as the friendly names in the hyperlink, the
expression:

INDIRECT("'Sheet2'!B"&ROW(A1)*20-20+5))

Essentially we wrapped INDIRECT(...) around the earlier expression:
"Sheet2!B"&ROW(A1)*20-20+5

(Just regard the additional pair of apostrophes inserted before/after the
sheetname as a good practice to do when it comes to referencing sheetnames
within INDIRECT)

INDIRECT("'Sheet2'!B"&ROW(A1)*20-20+5))
would similarly evaluate to:

INDIRECT("Sheet2!B5"), INDIRECT("Sheet2!B25"), etc
as we copy down from the starting cell.

and INDIRECT(...) would then resolve all the textstrings
to return the actual contents of what's in:
Sheet2!B5, Sheet2!B25, Sheet2!B45, etc

(if the referenced cells were empty,
we'd simply get zeros returned)

As for HYPERLINK(...), and the ways that it functions with the pound sign
(#), CELL(...) and INDIRECT(...), please see Dave McRitchie's detailed
coverage at his:
http://www.mvps.org/dmcritchie/excel....htm#hyperlink
(scroll down to around mid-way on that page)

Hope the above helps ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---