Here's an alternative:
Function OtherSheet(ByVal vRng As Variant, _
Optional ByVal iIndex As Long = 1, _
Optional bRelative As Boolean = True) As Range
' shg 2010
' Returns Range(vRng) on
' Worksheets(iIndex) if bRelative = False
' Worksheets(iIndex + Application.Caller.Worksheet.Index) if bRelative = true
' Defaults to the range on Application.Caller.Worksheet.Next
' If the referenced range doesn't overlap the calling range, just pass the range:
' =SUM(OtherSheet(A1:A3))
' If they do, pass the range reference in quotes to avoid a circular reference error:
' =SUM(OtherSheet("A1:A3"))
' To pass multi-area ranges, enclose in parens or quotes:
' =SUM(OtherSheet((A1:A10, C1:C5), 2, False))
' =SUM(OtherSheet("A1:A10, C1:C5", 2, False))
' No error checking -- it's a UDF _only_
Application.Volatile True
If TypeOf vRng Is Range Then vRng = vRng.Address
With Application.Caller.Worksheet
If bRelative Then iIndex = .Index + iIndex
Set OtherSheet = .Parent.Worksheets(iIndex).Range(vRng)
End With
End Function
In each worksheet other than "1", in B6 and copy across,
=OtherSheet(B37, -1)
The function is, per force, volatile.
Bookmarks