+ Reply to Thread
Results 1 to 8 of 8

Getting error trying to "group" by Day, Month and Year on a pivot table

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Getting error trying to "group" by Day, Month and Year on a pivot table

    Hi,

    Below is the code i am using to try and group by day, month and year using vba for a pivot table. But its giving me an error. I cant publish the entire file as it is too big and has "sensitive" data in it.

    Please Login or Register  to view this content.
    I think the issue with the "text" .LabelRange.Group but i am not sure.

    Any ideas?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Getting error trying to "group" by Day, Month and Year on a pivot table

    What is the error message?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Getting error trying to "group" by Day, Month and Year on a pivot table

    Run-Time Error: 1004
    "Group method of Range class failed"

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Getting error trying to "group" by Day, Month and Year on a pivot table

    Can you manually do the grouping?

  5. #5
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Getting error trying to "group" by Day, Month and Year on a pivot table

    and it errors out on this line of code

    ".LabelRange.Group Start:=True, End:=True, Periods:=Array(False, False, False, True, True, False, True)"

  6. #6
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Getting error trying to "group" by Day, Month and Year on a pivot table

    yes and when i record it i get this

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Getting error trying to "group" by Day, Month and Year on a pivot table

    anybody know?

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Getting error trying to "group" by Day, Month and Year on a pivot table

    What happens if you split the code up like this?
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. "Cannot group that selection" error in pivot table work-around
    By kfryar in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-07-2014, 02:46 AM
  2. [SOLVED] run time error creating pivot table and group dates by year and month
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2013, 07:25 AM
  3. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  4. Replies: 0
    Last Post: 02-01-2006, 03:35 AM
  5. [SOLVED] "Cannot Group That Selection" in a Pivot Table.
    By les8 in forum Excel General
    Replies: 1
    Last Post: 11-09-2005, 11:20 AM
  6. [SOLVED] Setting up "Year to Date" Calculations in a Pivot Table
    By Project64 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-21-2005, 10:06 PM

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