Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
RestlessAde
 
Posts: n/a
Default Updating Page Field of Pivot Tables from Form Control

Hi,

I would like to use a pull down menu to feed into a pivot table page field.
So for example, when I select employee name in the pull down menu of the
form, that employee name is used as the page field value for a pivot table.

I'm assuming this needs to be done in VB, but can't work out how. Any advice
would be much appreciated

Thanks,
Ra
  #2   Report Post  
William Horton
 
Posts: n/a
Default

This is very raw but it works.

Sub PivotTable()
ActiveSheet.PivotTables("PivotTable2").PivotFields ("Name").CurrentPage =
ActiveSheet.Range("A8").Value
End Sub

This assumes you are running macro from the activesheet and that the data
and pivot table are on the same sheet. If not please adjust code. It also
assumes that "Name" is the page field title you are using. Lastly it assumes
that the pull down menu value in the form is located in cell A8. Please
adjust as necessary. With that said when this macro runs it will change the
page field Name to whatever is in cell A8. You may want to add this code
along with other code to the change event of the worksheet that contains your
form. That way you can program it so that the pivot table changes/refreshes
automatically whenever the drop down value in the form is changed.

Hope this gets you started.

Thanks,
Bill Horton

"RestlessAde" wrote:

Hi,

I would like to use a pull down menu to feed into a pivot table page field.
So for example, when I select employee name in the pull down menu of the
form, that employee name is used as the page field value for a pivot table.

I'm assuming this needs to be done in VB, but can't work out how. Any advice
would be much appreciated

Thanks,
Ra

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot table page field switch to (all) if my criteria is not avail Angus Excel Discussion (Misc queries) 0 July 30th 05 05:06 AM
Multiple Pivot Tables with single Page Field cscribner Excel Discussion (Misc queries) 1 May 26th 05 12:26 AM
Pivot Table Page field link to cell Santhosh Mani Excel Worksheet Functions 0 May 12th 05 05:58 AM
I cannot drag a Pivot Table field into the page area KimboR Excel Discussion (Misc queries) 2 February 23rd 05 02:29 PM
Pivot Table Page Field Jimbola Excel Discussion (Misc queries) 0 February 6th 05 09:13 PM


All times are GMT +1. The time now is 10:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"