![]() |
Group Method failed in macro
Dear all,
I have an Excel Workbook which contains 2 sheets. Each sheet has a pivot table and the pivot tables on both pages are generated by the same macro program. Below is part of the codes: : : : With ActiveSheet.PivotTables(sTablename).PivotFields("Q uantity Supplied") .Orientation = xlDataField .Caption = "Shipped Quantity" .Position = 2 .NumberFormat = "#,##0.00" .Function = xlSum End With With ActiveSheet.PivotTables(sTablename).PivotFields("S hip Balance") .Orientation = xlDataField .Caption = "Shipment Balance" .NumberFormat = "#,##0.00" .Function = xlSum End With Range("E3").Select Selection.Group Start:=True, End:=True, Periods:=Array(False, False, False, _ False, True, True, True) Range("E3").Select With ActiveSheet.PivotTables(sTablename).PivotFields("Y ears") .Orientation = xlPageField .Position = 2 End With : : : Each pivot tables carries different data range from the same data source. The pivot table in sheet1 can be generated successfully, but it fails in sheet2. The debugger stops at "Selection.Group Start:=True, End:=True, Periods:=Array(False, False, False, False, True, True, True)" and the error message is "Group Method of Range class failed". The problem exists since last week and it has never happened before. I suspect that it is a problem of data instead of the program. Anyone has an idea? Thanks a million! Ivan |
All times are GMT +1. The time now is 07:07 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com