LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default need macro to filter data from multiple sheets in a worksheet

Sounds easy enough. Assuming your data is something like:

(col a) (col b)
Header1 values
a 73
b 84
c 31
a 14
b 24
b 88
c 46
c 89
b 22
d 67
d 48
c 75
d 67
a 64
d 92

then this:

Sub test()
Cells.Sort _
key1:=Range("A2"), Order1:=xlAscending, _
Header:=xlYes, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Cells.Subtotal _
GroupBy:=1, _
Function:=xlSum, _
TotalList:=Array(2), _
Replace:=True, _
PageBreaks:=False, _
SummaryBelowData:=True
End Sub

would produce:

Header1 header2
a 73
a 14
a 64
a Total 151
b 84
b 24
b 88
b 22
b Total 218
c 31
c 46
c 89
c 75
c Total 241
d 67
d 48
d 67
d 92
d Total 274

Grand Total 884


 
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
Hyperlink and Filter Data in Multiple Sheets Sheikh Saadi Excel Discussion (Misc queries) 0 March 13th 09 07:02 AM
macro to find data and filter it and copy to another worksheet kay Excel Programming 1 October 18th 08 09:30 PM
Creating a macro to filter data on multiple sheets catfish#hunter Excel Programming 0 May 22nd 08 09:10 PM
Macro to Filter Information in Multiple sheets and Make graph misschanda via OfficeKB.com Excel Worksheet Functions 0 August 24th 07 03:25 PM
Combine multiple sheets of data into one worksheet Jason Excel Discussion (Misc queries) 1 June 17th 07 01:07 PM


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