View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default question about many sheets in one warkbook

I'm not sure if Excel allows you to simply drill the array on the z
dimension (rows, columns, sheets = x, y, z). If there are no other
suggestions, you could try something in VBA like:

Public Function SumIfZCore(strToMatch as string) as Double
Dim ws as Worksheet, numTemp as Double
For Each ws in ActiveWorkbook.Worksheets
If ws.Range("A5").Text = strToMatch Then numTemp = numTemp +
ws.Range("H31").Value
Next ws
SumIfZCore = numTemp
End Function

Not sure if you can use Range like that without selecting the sheet,
but you get the idea.

Then in a cell you can type =SumIfZCore("KAI"), and it will give you
the answer. You could expand the custom function to specify what
address to look-in and what address(es) to sum as well.

HTH