How to use a value of a specific cell from a named range?

129 views Asked by At

I have a series of tables that all have names (i.e. they are named ranges). These tables add a series of numbers together and then provide a total in the very bottom right hand cell of the rectangular table. These tables are pasted into the document in different locations depending on where the user puts them.

So the question is, how do I, knowing the Name of each of these tables, extract the value of the totals cell in the bottom right hand corner of these tables and then add them together into a cell?

2

There are 2 answers

1
hammus On BEST ANSWER

In the absence of any information about what you have tried already something like this should work:

Dim sumTotal as Integer
Dim NamedRange as Range
Set NamedRange = ActiveSheet.Range("NameOfRange")

'Find the Bottom Right Corner
sumTotal = sumTotal + NamedRange.Cells(1, 1).Offset(NamedRange.Rows.Count - 1, NamedRange.Columns.Count - 1).Value

'do this for each NamedRange
1
pnuts On

If tables as in Insert > Tables - Table then with a formula such as:

=Table1[[#Totals],[sum]]+Table2[[#Totals],[sum]]+Table3[[#Totals],[sum]]  

SO20555364 example