View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey Richard Buttrey is offline
external usenet poster
 
Posts: 296
Default Indirect Function() - summing across sheets

Hi,

I'm struggling to unnderstand what's wrong with the following, and
after googling around I saw one comment that INDIRECT() was somewhat
problematic if using across worksheets.

I have several sheets, the first is named "RGB1" and a later one is
named "RGB9", in between are other sheets with values in B2, all of
which I want to add. There are sheets after RGB9 which I don't want
included.

So the formula

=SUM(RGB1:RGB9!$B$1) works fine.

However for various reasons I want to hold the names of the two sheets
in A1 & A2 since these are variables. I've tried all sorts but am
unable to get an INDIRECT() to work. The obvious

=SUM(INDIRECT(A1&":"&A2&"!"&$B$1)) doesn't work, nor indeed something
like

=SUM(INDIRECT("'" & A1 & ":" & A2 &"'!"&$B$1))

or various other combinations using quotes around the A1 & A2
references.

Any ideas please? Usual TIA

Rgds

__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________