+ Reply to Thread
Results 1 to 11 of 11

Pivot table source range variable

  1. #1
    Forum Contributor
    Join Date
    06-15-2011
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    117

    Pivot table source range variable

    What on earth am I doing wrong here - tearing my hair out!

    Please Login or Register  to view this content.
    It doesn't seem to like mixing the long with a range, how can I fix this? Thanks in advance.
    Last edited by tone640; 05-14-2012 at 06:45 AM.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Pivot table source range variable

    it needs to be text
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor
    Join Date
    06-15-2011
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    117

    Re: Pivot table source range variable

    Thanks for your help, I'm getting a different error saying that the pivot table field name is not valid, and needs to use data in a list with labelled columns.

    I have checked that every column from A to BQ has a heading, but still no luck.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Pivot table source range variable

    are you sure you have no hidden columns with blank headers and that the headers are in row 1? if so, maybe you have an invalid character in the field name - can you manually create a pivot table from the data?

  5. #5
    Forum Contributor
    Join Date
    06-15-2011
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    117

    Re: Pivot table source range variable

    Yes, no hidden columns or blanks in row 1, and I can update the sourcedata for the pivot table manually.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Pivot table source range variable

    are you sure that the code is using the correct sheet? a sample workbook would probably speed this up. ;-)

  7. #7
    Forum Contributor
    Join Date
    06-15-2011
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    117

    Re: Pivot table source range variable

    Sample workbook attached...
    Attached Files Attached Files

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Pivot table source range variable

    weird. seems to work with R1C1 format (which I prefer with pivots anyway especially with large datasets)
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-15-2011
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    117

    Re: Pivot table source range variable

    Ah so simple but it's odd you can't use the other format...

    Thanks for your help, it is much appreciated.

  10. #10
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Pivot table source range variable

    Why not just use a dynamic named range and skip the VBA?

  11. #11
    Forum Contributor
    Join Date
    06-15-2011
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    117

    Re: Pivot table source range variable

    Thanks for the suggestion - that would be a better way

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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