View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Eric Holmes Eric Holmes is offline
external usenet poster
 
Posts: 1
Default response to question about sheet referencing

There are two reasonable solutions I've used:

1) First, set up one column with all references as desired, making sure that all row/column references are fixed (e.g. 'Smith'!$C$3, not 'Smith'!C3). Then copy that column into the remaining columns. Finally, for each column after the first one, select the appropriate cells within that column, then use Ctrl-H (Find and Replace) to change 'Smith' to 'Jones', 'Smith' to 'Martin', etc. This will replace the text within the formula so that it refers to the appropriate sheet.

2) A second approach is to use the INDIRECT worksheet function. The only argument in this function is a text string, which you can construct with standard cell references. For example, suppose that in Column B of your summary sheet, you want to display the value in cell B2 on each of the named worksheets ('Smith', 'Jones', 'Martin', etc.). Then set it up as follows:

Col A Col B
Row 1 Smith =INDIRECT(A1 & "!B2")
Row 2 Jones =INDIRECT(A2 & "!B2")
Row 3 Martin =INDIRECT(A3 & "!B2")

Take note of a few considerations:
(i) There is no need for any $'s in the B2 reference, since it is contained in quotes as part of the text string being constructed (although including them wouldn't cause any problems)

(ii) The obvious advantage of this is that you can copy / fill the formula from the first row into the remaining rows

(iii) It may be necessary to include single quotes around the sheet name if there are any spaces in the sheet name [e.g. =INDIRECT("'" & A1 & "'!B2")]

(iv) If there are many columns to fill, you can use an additional cell reference within the text string to avoid having to edit each column's formula:

Col A Col B Col C ...
R1 "!B2" "!C2"
R2 Smith =INDIRECT($A1&B$1) =INDIRECT($A1&C$1)
R3 Jones =INDIRECT($A2&B$1) =INDIRECT($A2&C$1)
R4 Martin =INDIRECT($A3&B$1) =INDIRECT($A3&C$1)
..
..
..

In case it's not clear already, the first method is probably best if there are relatively few tab names to replace. The second one is a bit trickier to set up but much quicker if there are, say, 20 or more tabs.

I hope this helps!