ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Referencing named ranges (https://www.excelbanter.com/excel-programming/341843-referencing-named-ranges.html)

FinChase

Referencing named ranges
 
I have created some code that counts a range and adds the count total and sum
defines that range as a named range. This part works fine, and I use this
code to count several ranges. I then want to put these counts together at
the bottom of the worksheet. Again, I can easily reference the range, and it
puts the result as a static number, but if the count of the range changes
(which it usually does), the numbers at the bottom do not update. I would
like it to be able to update whenever the range updates.

This the code I am using. The range name is EE_Count_Total.

ActiveCell.Formula = Range("=ee_count_total")

Can anyone help? Thanks!

Tom Ogilvy

Referencing named ranges
 
if ee_count_total is the name of a cell that contains the count then:

ActiveCell.Formula = "=ee_count_total"


--
Regards,
Tom Ogilvy

"FinChase" wrote in message
...
I have created some code that counts a range and adds the count total and

sum
defines that range as a named range. This part works fine, and I use this
code to count several ranges. I then want to put these counts together at
the bottom of the worksheet. Again, I can easily reference the range, and

it
puts the result as a static number, but if the count of the range changes
(which it usually does), the numbers at the bottom do not update. I would
like it to be able to update whenever the range updates.

This the code I am using. The range name is EE_Count_Total.

ActiveCell.Formula = Range("=ee_count_total")

Can anyone help? Thanks!





All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com