<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>鱼杆鱼堂 &#187; excel</title>
	<atom:link href="http://www.pumaboyd.com/archives/tag/excel/feed" rel="self" type="application/rss+xml" />
	<link>http://www.pumaboyd.com</link>
	<description>If you think you can ,you can</description>
	<lastBuildDate>Wed, 18 May 2011 00:52:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Excel分类汇总宏(VBA)</title>
		<link>http://www.pumaboyd.com/archives/excel%e5%88%86%e7%b1%bb%e6%b1%87%e6%80%bb%e5%ae%8fvba</link>
		<comments>http://www.pumaboyd.com/archives/excel%e5%88%86%e7%b1%bb%e6%b1%87%e6%80%bb%e5%ae%8fvba#comments</comments>
		<pubDate>Mon, 22 Dec 2008 01:06:15 +0000</pubDate>
		<dc:creator>pumaboyd</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[excel]]></category>

		<guid isPermaLink="false">http://www.pumaboyd.com/?p=392</guid>
		<description><![CDATA[几百个Sheet要进行分类汇总的操作，并且需要将汇总的数据拷贝到一张空sheet。这就是MM的需求，不多解释了。能用的上就复制吧，细节问题copy者请自行修改。 Sub mSubtotal() Dim LastRow As Long Dim sh As Worksheet For Each sh In ThisWorkbook.Worksheets Rem 分类汇总 On Error GoTo err If sh.Name "pumaboyd" Then LastRow = sh.Range("A65536").End(xlUp).Row sh.Range("A2:AE" &#038; LastRow).Sort Key1:=sh.Range("b2"), Order1:=xlDescending, Header:= _ xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ SortMethod:=xlPinYin, DataOption1:=xlSortNormal sh.Range("A2:AE" &#038; LastRow).Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(5, 12, 14), Replace:=True, PageBreaks:=False, SummaryBelowData:=True sh.Outline.ShowLevels [...]]]></description>
			<content:encoded><![CDATA[<p>几百个Sheet要进行分类汇总的操作，并且需要将汇总的数据拷贝到一张空sheet。这就是MM的需求，不多解释了。能用的上就复制吧，细节问题copy者请自行修改。<br />
<span id="more-392"></span></p>
<pre lang="vb">
Sub mSubtotal()
    Dim LastRow As Long
    Dim sh As Worksheet
    For Each sh In ThisWorkbook.Worksheets
        Rem 分类汇总
        On Error GoTo err
        If sh.Name <> "pumaboyd" Then
            LastRow = sh.Range("A65536").End(xlUp).Row
            sh.Range("A2:AE" &#038; LastRow).Sort Key1:=sh.Range("b2"), Order1:=xlDescending, Header:= _
            xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            SortMethod:=xlPinYin, DataOption1:=xlSortNormal
            sh.Range("A2:AE" &#038; LastRow).Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(5, 12, 14), Replace:=True, PageBreaks:=False, SummaryBelowData:=True

            sh.Outline.ShowLevels RowLevels:=2
            sh.Activate

 		Cells.Select
    		Selection.EntireRow.Hidden = False
            sh.Range("B3").Select

            Selection.SpecialCells(xlCellTypeVisible).Select
            Selection.Copy

            Sheets("pumaboyd").Activate
            Sheets("pumaboyd").[B65536].End(xlUp).Offset(1, 0).Value = sh.Name
            Sheets("pumaboyd").[B65536].End(xlUp).Offset(1, -1).Select
            Sheets("pumaboyd").Paste

        End If

err:

          Debug.Print err.Description
'msgbox Err.Description
          Resume Next

    Next

End Sub
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.pumaboyd.com/archives/excel%e5%88%86%e7%b1%bb%e6%b1%87%e6%80%bb%e5%ae%8fvba/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

