Consulting

Results 1 to 14 of 14

Thread: Dynamic Range and Pivot problem

  1. #1

    Dynamic Range and Pivot problem

    hi,

    I have set a dynamic range called Bexley Pivot Data on a sheet called "Bexley Copy Data", which has data in cols A:H, by using the procedure, Insert, name, define

    and the following formula =OFFSET(Bexley Copy Data!A$1,0,0,COUNTA(Bexley Copy Data!$A:$A),8)

    I have a pivot table on a seperate sheet called Pivot, and I have tried to make the source data the range "Bexley Pivot Data", and it says "Reference not valid"...driving me mad...

    also, I have noticed that I cannot select the range in the dropdown section...its just not there....

    I have some VBA which is supposed to refresh this pivot, but obviously it can't! It seems to pick up range A14999 every time, god knows why

  2. #2
    It looks to me like your Names are not valid. Try removing the spaces
    Hope that helps.
    Get the free Excel based Toolbar or click here for free examples & Excel Consultancy

    RoyUK

  3. #3
    hi roy

    cheers for that but I mis-typed in my post...the rangename I am trying to use is BexleyPivotData...has no spaces...

    The sheet name does ie Bexley Copy Data...don't think thats it?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Immatoity
    hi roy

    cheers for that but I mis-typed in my post...the rangename I am trying to use is BexleyPivotData...has no spaces...

    The sheet name does ie Bexley Copy Data...don't think thats it?
    No but you should enclose with single quotes ws names with spaces.

    But that won't solve your problem.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    hmmm a little confused by your reply xld??

    What should I do?

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Immatoity
    hmmm a little confused by your reply xld??

    What should I do?
    Sorry mate, didn't mean to confuse.

    I am afraid I don't know, I dislike pivot tables with a passion, so I never use them. I did a test with your data, making appropriate corrections, but it still didn't work, so I came to the (maybe incorrect) conclusion that pivot tables do not support dynamic ranges.

    If I am correct, you are stuffed. But, I like to think Excel is more flexible that that, so maybe someone will prove me wrong.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    When I use PivotTables - which I personally find them to be invaluable, I use Dynamic Named ranges. Reading your post properly, it seems to me that you are referencing a non-existent range. Recreate the name & check the name exists afterwards.If you are having trouble with the range attach your workbook.
    Hope that helps.
    Get the free Excel based Toolbar or click here for free examples & Excel Consultancy

    RoyUK

  8. #8
    here's an example using a Dynamic named range
    Hope that helps.
    Get the free Excel based Toolbar or click here for free examples & Excel Consultancy

    RoyUK

  9. #9
    cheers lads...will try that...but will have to be at home later, as works firewall does not allow zip files to be downloaded...even if they will save users within the business hours!!

    ridiculous!

    I will also upload my file if I can't get it working...

    ta for now

  10. #10
    Hi....sorry forgot to dload at home....can someone kindly email me the file? Zip files are allowed via email...pm me for address plz

  11. #11
    Hi, I was searching for something else and came across this. Did you ever get it sovled? You could try the following for the named range.
    (=OFFSET(Source!$A$1,0,0,COUNTA(Source!$A:$A),COUNTA(Source!$1:$1)))
    Where Source would be your BexleyPivotData.
    I hope it help, albiet very late.
    SherryO

  12. #12
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    The named range itself is not the issue, and they won;t always show up in the drop down menu. BASIC syntax for refresh tables in code...

    [VBA]
    Sub RefreshPivot()
    Dim Ws As Worksheet
    Dim PT As PivotTable
    Set Ws = Sheets("Sheet1") 'name your sheet containing the pivot table

    Ws.Activate
    ActiveSheet.PivotTables("PivotTable1").RefreshTable
    'in Pivot Table >Table Options you can see the name
    'change the name to your pivot table


    'Note: You do not refresh the named range, only the query table..

    End Sub
    [/VBA]
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




  13. #13
    Replied to the wrong thread... Oops
    Last edited by SherryO; 01-27-2006 at 12:55 PM. Reason: Not Applicable

  14. #14
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    Sherry, my reply was intended for the orginal poster, I have replied to your new thread...
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




Posting Permissions

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