+ Reply to Thread
Results 1 to 3 of 3

Using SUM with a custom built range

  1. #1
    Floyd
    Guest

    Using SUM with a custom built range

    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.


  2. #2
    Tim Williams
    Guest

    Re: Using SUM with a custom built range

    dim r as range, blah

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

    blah=Application.WorksheetFunction.Sum(r)



    Tim.


    "Floyd" <batesf@pioneernrc.com> wrote in message
    news:1108080827.326975.306500@f14g2000cwb.googlegroups.com...
    > 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.
    >




  3. #3
    floydbates@earthlink.net
    Guest

    Re: Using SUM with a custom built range

    Mr. Williams,

    Thank you.

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

    Cheers.

    Floyd


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1