Help with changing formula

G

Guest

I have a workbook that will be used by several others. I need to find a way
to get totals from each sheet and add them together on the "Overview" sheet.
For example, on Overview sheet Cell C5 might have
='Account1!AF100+'Account2'!AF100+'Account3'!AF100+'Account4'!AF100

The issue I am having is that each user of this sheet will have a different
number of "Account?" sheets and there will be no naming consistancy as they
would put the actual account name for the sheet name.

Is there a way to simply do this or else what is the best programatically
way to accomplish this?

Thanks,
BradK
 
D

Don Guillett

try
=sum(sheetfirst:sheetlast!af100)
where they fill in the name of the 1st and last sheet
 
D

Don Guillett

a macro
Sub getsum1()
Range("A8").Formula = _
"=SUM('" & Worksheets(2).Name & ":" & _
Worksheets(Worksheets.Count - 1).Name & "'!A8)"
End Sub
 
G

Guest

Hi,
I suggest you not use the "name" of the avccount, but the account numer,
then a solution would be to use a vlookup, something like this
=VLOOKUP(A2,Sheet2!A2:B4,2,FALSE)+VLOOKUP(A2,Sheet3!A2:B4,2,FALSE)+VLOOKUP(A2,Sheet4!A2:B4,2,FALSE)
Where the lookup value is in "A1" sheet1. If you make the formula absolute,
you can copy it down.
Then the formula looks like this
=VLOOKUP(A2,Sheet2!$A$2:$B$4,2,FALSE)+VLOOKUP(A2,Sheet3!$A$2:$B$4,2,FALSE)+VLOOKUP(A2,Sheet4!$A$2:$B$4,2,FALSE)

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top