Vb question with pivot tables

Last Edited By Krjb Donovan
Last Updated: Mar 05, 2014 10:00 PM GMT

Question

I'm looking for a solution with VBA. My proficiency is to the extent I can sort of review code and determine what it is doing and I can tweak code to make minor changes; however, I cannot actually program.

Hi Victor! I'm also anexpert at allexperts; however, I'm working on a personal project in which I need some VBA code and it is outside of my knowledge area. Please note I have a great grasp of Pivots and Filters so it is just the code itself I'd like someone to whip up for me (and then I'd be personally grateful - woohoo!

Here is a summary of something I posted on a public website last week; however, I didn't receive any responses...

I have a pivot table output such as this¡­

Territory County Value1 Value2 3 TARRANT 599,328.44 395,832.96 1 HARRIS 684,657.42 1,037,208.37

I also have set up a macro to provide detail for the item in Value2 for whatever happens to be in the top row. Here is a sample of the advanced filter:

County Territory HARRIS 1

This then goes to another detail spreadsheet and only displays the rows showing the detail requested (as you would expect an advanced filter to work); however, I would like to jazz this up somewhat to where the user has an option of a row other than the first row.

I know if I select a cell, such as the one containing $1,037,208.37,does know by simply selecting this cell that I have selected Pivot Criteria ¡°1¡± and ¡°Harris¡±. Is it possible, with a VB Macro, to populate this over to the Advanced Filter? I would do this by selecting the cell and then clicking a button at the top of the spreadsheet that would run the VB Macro (the button would say ¡°view detail¡±). I can create a button and the macro to update the filter (the easy part), but the VB Macro for getting the cell information and criteria eludes me.

For example purposes you may assume everything is in A:D and rows 1:3, etc. Ultimately I will need someone to just provide me with the VB code to grab the info and post it to the corresponding fields in the advanced filter - I really know nothing about VB other than my inept skill at making code via macros and then tweaking it to do what I want .

NOTE: Simply double-clicking on the value2 to provide the Pivot Detail will not work for this situation. The pivot detail actually does not contain all of the information I ultimately want to show to the end-user.


Victor - please let me know if I can provide any additional information. I may not have been very clear and I can certainly clarify.

Answer

However, I'm not too sure if I understand all you wrote. Do you mean that you want the user to double-click on the pivot table, and it will automatically create the filter and show the data?

Please send me your file so that I can have a better idea of the task.

Advertisement

©2020 eLuminary LLC. All rights reserved.