G
Guest
I'm using Excel 2003. I have an excel macro that creates multiple sections.
Each section has multiple columns that are totaled. Each section's totals
row has a name. I want to add a row that sums the first 4 sections. If all
4 sections are in the worksheet, the following code works:
Selection.FormulaR1C1 = "=SUM(MyRange1 + MyRange2 + MyRange3 + MyRange4)
However, if any one (or more) of those sections are missing, it inserts
#REF!. Is there a way that I'm overlooking to have it add only the total
rows that exist?
Each section has multiple columns that are totaled. Each section's totals
row has a name. I want to add a row that sums the first 4 sections. If all
4 sections are in the worksheet, the following code works:
Selection.FormulaR1C1 = "=SUM(MyRange1 + MyRange2 + MyRange3 + MyRange4)
However, if any one (or more) of those sections are missing, it inserts
#REF!. Is there a way that I'm overlooking to have it add only the total
rows that exist?