Range.Subtotal Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates subtotals for the range (or the current region, if the range is a single cell).
public object Subtotal (int GroupBy, Microsoft.Office.Interop.Excel.XlConsolidationFunction Function, object TotalList, object Replace, object PageBreaks, Microsoft.Office.Interop.Excel.XlSummaryRow SummaryBelowData = Microsoft.Office.Interop.Excel.XlSummaryRow.xlSummaryBelow);
Public Function Subtotal (GroupBy As Integer, Function As XlConsolidationFunction, TotalList As Object, Optional Replace As Object, Optional PageBreaks As Object, Optional SummaryBelowData As XlSummaryRow = Microsoft.Office.Interop.Excel.XlSummaryRow.xlSummaryBelow) As Object
Parameters
- GroupBy
- Int32
Required Integer. The field to group by, as a one-based integer offset. For more information, see the example.
- Function
- XlConsolidationFunction
Required XlConsolidationFunction. The subtotal function. Can be one of the following XlConsolidationFunction constants:xlAveragexlCountxlCountNumsxlMaxxlMinxlProductxlStDevxlStDevPxlSumxlUnknownxlVarxlVarP
- TotalList
- Object
Required Object. An array of 1-based field offsets, indicating the fields to which the subtotals are added. For more information, see the example.
- Replace
- Object
Optional Object. True to replace existing subtotals. The default value is False.
- PageBreaks
- Object
Optional Object. True to add page breaks after each group. The default value is False.
- SummaryBelowData
- XlSummaryRow
Optional XlSummaryRow. Places the summary data relative to the subtotal. Can be one of the following XlSummaryRow constants:xlSummaryAbovexlSummaryBelowdefault
Returns
Applies to
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기