+ Reply to Thread
Results 1 to 3 of 3

Syntax - Control pviot table with Cell value

  1. #1
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Syntax - Control pviot table with Cell value

    Hi All,
    I am trying to control Excel PIVOT tables from a cell value with VBA. The field is at G1.
    When I used below it is ok.
    ActiveSheet.PivotTables("PivotTable3").PivotFields("PN").CurrentPage = "PN123"

    but when I changed it to a variable so that it references G1 value, it goes to syntax error.
    ActiveSheet.PivotTables("PivotTable3").PivotFields("PN").CurrentPage = "A1"

    Any help is appreciated.

    Regards,
    Nironto

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    09-17-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Syntax - Control pviot table with Cell value

    There is a mistake while using variables

    Please Login or Register  to view this content.
    Or you can use it like this

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Re: Syntax - Control pviot table with Cell value

    Thanks mohan.pandey87! Great Help!

+ 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 control table array in vlookup by using a cell
    By Thonkhan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-27-2014, 04:43 AM
  2. VBA coding; control cell that controls pivot table filter
    By cmitc013 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2013, 10:08 AM
  3. syntax for Control Source
    By dpenny in forum Excel General
    Replies: 3
    Last Post: 04-13-2007, 07:53 PM
  4. Syntax to return the value of a control by reference
    By Broadband Al in forum Excel General
    Replies: 3
    Last Post: 01-25-2006, 09:25 PM
  5. Syntax for de-selecting a control?
    By William DeLeo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2005, 11:56 AM

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