+ Reply to Thread
Results 1 to 5 of 5

get subtotals results as a variable

  1. #1
    Wrzesiñski
    Guest

    get subtotals results as a variable

    Hi, every month I've got spreadsheet with payments (thousands of rows).
    Usually I'm using subtotals to get sums grouped by currency. I know how to
    write code in VBA for subtotals, but how can I get the results for
    subtotals eg. as a variable? Number of payments is different every month,
    so I can't used hard references to cells.
    Or is it possible to name (named range) cells with subtotals results?

    --
    Przemek
    Now playing: nothing

  2. #2
    David
    Guest

    RE: get subtotals results as a variable

    How many currencies do you have to subtotal and how many columns are you
    subtotaling?
    --
    David


    "Przemek Wrzesiński" wrote:

    > Hi, every month I've got spreadsheet with payments (thousands of rows).
    > Usually I'm using subtotals to get sums grouped by currency. I know how to
    > write code in VBA for subtotals, but how can I get the results for
    > subtotals eg. as a variable? Number of payments is different every month,
    > so I can't used hard references to cells.
    > Or is it possible to name (named range) cells with subtotals results?
    >
    > --
    > Przemek
    > Now playing: nothing
    >


  3. #3
    Wrzesiñski
    Guest

    Re: get subtotals results as a variable

    Pięknego dnia, a był to 7 sierpień (niedziela) 2005, osobnik ukrywaj±cy się
    pod pseudonimem David w wiadomo¶ci
    <news:E2A5A789-A30E-4AD2-B562-61E2A4FB8A53@microsoft.com> napisał/a:
    > How many currencies do you have to subtotal and how many columns are you
    > subtotaling?


    I've got 3 currencies and I'm subtotaling only one column (amount).
    --
    Przemek
    Now playing: nothing

  4. #4
    David
    Guest

    Re: get subtotals results as a variable

    Hi,
    This may do it for you.
    Sub Macro1()
    Range("A1").Select
    Cells.Find(What:="* Total", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate
    Currency1 = ActiveCell.Offset(0, 1).Value
    Cells.FindNext(After:=ActiveCell).Activate
    Currency2 = ActiveCell.Offset(0, 1).Value
    Cells.FindNext(After:=ActiveCell).Activate
    Currency3 = ActiveCell.Offset(0, 1).Value
    End Sub
    --
    Thanks
    David


    "Przemek Wrzesiński" wrote:

    > Pięknego dnia, a był to 7 sierpień (niedziela) 2005, osobnik ukrywający się
    > pod pseudonimem David w wiadomości
    > <news:E2A5A789-A30E-4AD2-B562-61E2A4FB8A53@microsoft.com> napisał/a:
    > > How many currencies do you have to subtotal and how many columns are you
    > > subtotaling?

    >
    > I've got 3 currencies and I'm subtotaling only one column (amount).
    > --
    > Przemek
    > Now playing: nothing
    >


  5. #5
    Wrzesiñski
    Guest

    Re: get subtotals results as a variable

    Pięknego dnia, a był to 7 sierpień (niedziela) 2005, osobnik ukrywaj±cy się
    pod pseudonimem David w wiadomo¶ci
    <news:8332D3D1-DD50-40B7-A881-B06970E1E6AA@microsoft.com> napisał/a:
    [cut macro]

    Thanks a lot, it works

    --
    Przemek
    Now playing: "Metallica - Orion"

+ 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