Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default AutoFilter Summary Macro

To me this question sounds like a wish list macro but, I thought I
would give it a try anyway.
Here it goes;

I have a Spreadsheet with Autofiltering turned on. I would like to have
a macro that goes through a specified column's filter and give me a
subtotal summary of the various things found in the filter based off of
another column that has corresponding amounts in it.
Please see the example below.

Title 1 Amount Title 3 Title 4
101 3 101 Unique Data1
102 1 102 Unique Data1
103 5 103 Unique Data1
104 8 104 Unique Data2
105 2 105 Unique Data3
106 4 106 Unique Data4
107 6 107 Unique Data5
108 4 108 Unique Data3
109 2 109 Unique Data3

I would like the macro to create a temporary summary sheet (for
printing purposes) that does this.
Unique Data1 totaled 9
Unique Data2 totaled 8
And so on.
I would like all of the summary to appear on one sheet if possible.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default AutoFilter Summary Macro

Check out the DSUM and DCOUNT functions. They'll allow you to get your
totals by group, refreshed automatically, without having to cycle through
each of the filters. If you know that each set of criteria is unique, then
I'd set up something like:
Criteria1 Criteria2 Result
value1.1 value2.1 =DSUM(database, field, A$1:B2)
value1.2 value2.2 =DSUM(database, field, A$1:B3)-sum(c$2:c2).
Then autofill that second formula down.

"Magoo" wrote:

To me this question sounds like a wish list macro but, I thought I
would give it a try anyway.
Here it goes;

I have a Spreadsheet with Autofiltering turned on. I would like to have
a macro that goes through a specified column's filter and give me a
subtotal summary of the various things found in the filter based off of
another column that has corresponding amounts in it.
Please see the example below.

Title 1 Amount Title 3 Title 4
101 3 101 Unique Data1
102 1 102 Unique Data1
103 5 103 Unique Data1
104 8 104 Unique Data2
105 2 105 Unique Data3
106 4 106 Unique Data4
107 6 107 Unique Data5
108 4 108 Unique Data3
109 2 109 Unique Data3

I would like the macro to create a temporary summary sheet (for
printing purposes) that does this.
Unique Data1 totaled 9
Unique Data2 totaled 8
And so on.
I would like all of the summary to appear on one sheet if possible.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default AutoFilter Summary Macro

You can put a unique list of items on another sheet with Advanced filter.

Assume you place them starting in A2 and your original sheet is named data
with you table starting in A1

You can get you sums with

=Sumif(Data!D:D,A2,Data!B:B)

in B2 and then copied down.

code would be

Sub ABCD()
Dim rng As Range

With Worksheets("Data")
If .FilterMode Then
.ShowAllData
End If
.Range("A1").CurrentRegion.Columns(4).AdvancedFilt er _
Action:=xlFilterCopy, _
CopyToRange:=Worksheets("Summary").Range("A1"), _
Unique:=True
End With
With Worksheets("Summary")
Set rng = .Range(.Cells(2, 1), .Cells(2, 1).End(xlDown))
End With
rng.Offset(0, 1).Formula = "=Sumif(Data!D:D,A2,Data!B:B)"
End Sub

--
Regards,
Tom Ogilvy


"Magoo" wrote in message
ups.com...
To me this question sounds like a wish list macro but, I thought I
would give it a try anyway.
Here it goes;

I have a Spreadsheet with Autofiltering turned on. I would like to have
a macro that goes through a specified column's filter and give me a
subtotal summary of the various things found in the filter based off of
another column that has corresponding amounts in it.
Please see the example below.

Title 1 Amount Title 3 Title 4
101 3 101 Unique Data1
102 1 102 Unique Data1
103 5 103 Unique Data1
104 8 104 Unique Data2
105 2 105 Unique Data3
106 4 106 Unique Data4
107 6 107 Unique Data5
108 4 108 Unique Data3
109 2 109 Unique Data3

I would like the macro to create a temporary summary sheet (for
printing purposes) that does this.
Unique Data1 totaled 9
Unique Data2 totaled 8
And so on.
I would like all of the summary to appear on one sheet if possible.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default AutoFilter Summary Macro

Thanks I will try the suggestions.

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
autofilter with summary row Monkey-See, Monkey-Do[_2_] Excel Discussion (Misc queries) 2 June 15th 09 02:45 PM
Summary Sheet Macro Joco Excel Discussion (Misc queries) 1 July 17th 07 02:30 PM
A macro to make a summary sheet ADK Excel Programming 6 October 6th 05 08:18 PM
Summary Page Macro mjwillyone[_16_] Excel Programming 1 August 15th 05 10:53 PM
Ecxel Macro to summary and eliminate duplicates kdreyer Excel Programming 2 February 4th 05 10:19 PM


All times are GMT +1. The time now is 05:49 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"