Forum Discussion
Phildyche
Mar 31, 2022Copper Contributor
VBA coding to auto a sheet using Pivot Tables
Hello, I am having an issue with my sheet when I un the following code: Option Explicit Sub philautofill() ' ' Dim wsNew As Worksheet Dim rng As Range Dim ShName As String Dim dataws As Wo...
Phildyche
Apr 01, 2022Copper Contributor
Yes, I see the issue.. is there a way to take this out of the loop? I still want the new worksheet created to be named after what is in cell A5.
mtarler
Apr 01, 2022Silver Contributor
So I really don't know exactly what you are doing and have to ask if maybe you should be using a completely different approach like a Pivot Table or Power Query or even just using some of the new functions with dynamic arrays like FILTER()
- PhildycheApr 01, 2022Copper Contributor
mtarler So what I am trying to do is pull information from the pivot table that I have created. The information in cells A5, B5, C5,D5 and so on all change every time you make a different selection on the slicers. What I want this code to do is essentially " copy and paste" the information from the pivot table to the other sheet I showed to specific cells but if I use a simple copy and paste code it does not update the other sheet when I make different selections on the sliders. Basically I want to take the pivot table information and have it autofill the other sheet within specific cells.
- mtarlerApr 02, 2022Silver ContributorSo I don't think you want to just copy and paste on every change/update as that can cause problems. Maybe you are thinking of having a button and copy the values when you click the button? But wouldn't you also need the filter/slicer setting to go there also?
Are there a lot of different settings that you want to copy? or do you have a few specific values that you repeatedly use? If so maybe having multiple pivot charts with those fixed setting would be an option. Or maybe using the FILTER() function with those preferences could build a copy of those results.
In the mean time do you have some VBA code that is working or partially working? or is this project just starting?
Sorry I'm more questions than answers but you have to realize we only have a glimpse of what you are trying to do.