Results 1 to 4 of 4

Runtime Error on Grouping code

Threaded View

dezzer_18 Runtime Error on Grouping code 12-13-2012, 07:03 PM
TMS Re: Runtime Error on Grouping... 12-13-2012, 07:56 PM
dezzer_18 Re: Runtime Error on Grouping... 12-14-2012, 11:29 AM
TMS Re: Runtime Error on Grouping... 12-14-2012, 11:52 AM
  1. #1
    Registered User
    Join Date
    12-13-2012
    Location
    Mountains, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Runtime Error on Grouping code

    I am working on a project in Excel 2010 that requires me to group values in a generated pivot table. Ultimately, I plan to create a loop that will filter the pivot, dynamically group the results, copy the final table to a new sheet, and then repeat for each item in page filter. I have 99% of the rest of the code figured out, but the section that groups the data keeps kicking out a runtime error. Because the data I am working with is senstive, I have created a hypothetical file and the code is still giving me the runtime error in this simplified file. I feel like it has to be something simple, but I can't find it. Any help is greatly appreciated.

    Sub Group()
    
            Dim pt As PivotTable
            Dim ptField As PivotField
            Dim rPTRange As Range
     
            Set pt = Sheet1.PivotTables("GMPerctTableGen")
            Set ptField = pt.RowFields("GMPerct")
            Set rPTRange = ptField.DataRange.Cells(1, 1)
     
            rPTRange.Group Start:=True, End:=True, by:=0.8
    
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1