Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default 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
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
napisał/a:
[cut macro]

Thanks a lot, it works :)

--
Przemek
Now playing: "Metallica - Orion"


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
provide simultaneous results for a range of a particular variable [email protected] Excel Discussion (Misc queries) 2 December 29th 06 01:14 AM
Why do i have blank lines in my subtotals results BunnyMom Excel Worksheet Functions 2 April 8th 06 08:04 PM
Define drop-down results that are variable and dependent upon the. 33zenlane Excel Discussion (Misc queries) 4 December 13th 05 09:42 PM
Subtotal results in new column and then sorting subtotals ArtM Excel Worksheet Functions 1 January 18th 05 12:21 AM
Variable results to new workbook Fred[_20_] Excel Programming 1 October 7th 04 02:39 AM


All times are GMT +1. The time now is 01:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"