+ Reply to Thread
Results 1 to 4 of 4

run time error creating pivot table and group dates by year and month

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

    run time error creating pivot table and group dates by year and month

    hi, hope this goes through this time......2nd time trying to post this.


    ok, i have a data file see enclosed.
    main data is on sheet1.

    the macro creates a new worksheet in file called "pivottest" and it becomes first sheet in file.

    but i get a run time error when i run this.
    it stops on the section shown below where i think i am trying to group dates by year and month.

    also, on worksheet "grouping_how_i_want_2_look" i show what i would like the grouping to look like........

    any thoughts or help would be greatly appreaciated.


    note: prior to running the macro make sure to delete the "pivottest" worksheet other wise you get a run time error.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: run time error creating pivot table and group dates by year and month

    When you group something you need to make sure anything in the column does not contain any error value. When I removed all the #N/A from your dataset, the vba works for me.
    Attached Files Attached Files

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

    Re: run time error creating pivot table and group dates by year and month

    thanks...........i will review your enclosed doc in a bit.....but that makes sense..........

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

    Re: run time error creating pivot table and group dates by year and month

    that was it! thanks. i removed the error values as you suggested and it worked just fine.........thanks........

    i looked at this for 2.5hrs and could not figure it out.

    thanks!

+ 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. How to add Month-on-Month and Year-on-Year %Variance into a pivot table
    By emeritus1812 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 06-09-2013, 02:37 AM
  2. [SOLVED] Sort by Month and year in pivot table
    By mb1074 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 01-21-2013, 02:05 PM
  3. [SOLVED] Runt time error when creating pivot table
    By csh8428 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2012, 03:21 PM
  4. [SOLVED] PIVOT TABLES: Grouping dates by Fiscal Year, Quarter and Month
    By bimmer5dude in forum Excel General
    Replies: 5
    Last Post: 06-30-2012, 09:13 PM
  5. Pivot table - group dates per week or month
    By digicat in forum Excel General
    Replies: 1
    Last Post: 01-08-2006, 04:50 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