Using SUM with a custom built range

  • Thread starter Thread starter Floyd
  • Start date Start date
F

Floyd

One more thing today:

Thanks to everyone's help, I am able to read a cell in as a range
(CounterMarker). Once this cell is in the code, I can create the
following line $CI$9:$C$20 exactly as typed without quotes.

CounterMarker.Offset(-(YearDelta - 1), -1).AddressLocal() & ":" &
CounterMarker.Offset(0, -1).AddressLocal()) -->

When the line is passed into the equation below, it fails to execute.

Any suggestions.


Application.WorksheetFunction.Sum(CounterMarker.Offset(-(YearDelta -
1), -1).AddressLocal() & ":" & CounterMarker.Offset(0,
-1).AddressLocal())


Thanks in advance.

Cheers.
 
dim r as range, blah

set r=range(CounterMarker.Offset(-(YearDelta - 1), -1),
CounterMarker.Offset(0,-1))

blah=Application.WorksheetFunction.Sum(r)



Tim.
 
Mr. Williams,

Thank you.

I will make the necessary changes to my code first thing in the
morning.

Cheers.

Floyd
 
Back
Top