Excel 2010 Macro Pivot Label Filter - vba

I am having an issue running a label filter on a column (classic view) within my pivot table. I am trying to weed out the items in the data that are less than 180 days old. I can't adjust the data because it is used to feed multiple worksheets and I don't wish to copy the data and manipulate it for just this worksheet. Below is the line that I am running.
ActiveSheet.PivotTables("PivotTable5").PivotFields("Ageing").PivotFilters.Add _
Type:=xlCaptionIsBetween, Value1:="180", Value2:="9999"
This is a "between" filter. I have tried greater than and greater than or equal to but the same result occurs. After this line is run, I can click into the pivot table soft/filter down arrow and see that the filter is there as a between and even the days are inputted but the data does not reflect this. If I hit "OK" on the filter it then applies itself but I do not wish to have to do this manually.
Yes, "PivotTable5" is the pivot table in question. Can anyone help me automate this process?

Related

Create Line Graph with Dynamic Range based on values in columns of Dates from January that ends at YTD & be able to select which Clients are displayed

Been banging my head against the keyboard on this one.
I'm trying to create a dynamic Line Graph based on the below data and I'd like to avoid using VBA, if possible:
The "Title" column is the clients to display and the Date values make up the lines. There could be 3 clients or there could be 12. It varies. There are formulas going 30 rows down from the title row all the way through to "26-Dec" pulling from a raw data list, so those blank rows below TMKOMS actually have formulas in them.
I want a dynamic range that includes only the clients that are visible in the Title column.
On the Line Graph, I want a way to be able to select which client(s) to display (ie. drop-down boxes, check boxes or something).
I also need the Date range of values to dynamically capture "3-Jan" up to the year-to-date (eg. "21-Mar"), so that the Line Graph will only display up to 21-Mar. It would also be nice to have a way for users to select any one of the dates from a drop-down, but if the drop-down is blank, the dynamic range reverts to the year-to-date automatically.
Any help would be greatly appreciated.
I ended up solving all this by breaking down and using VBA to set autofilters.

Excel 2007 Pivot Table, Different Formulas in Different Columns

Created a Pivot Table in Excel 2007, and it seems I can only make it do one type of calculation at a time.
Is it possible to provide an average in one column, and a sum in the next?
When I click on "Value Field Settings", choosing any of the options applies it to every column in the Pivot Table, can't figure out how to apply it to only one column.
You can have a different calculation.
When you drop a field into the data section of the pivot change the calculation to sum.
Then drag the same field across again this time change it to average

SSRS Row Gropings Inverted (Export to Excel)

When i run my report my report in SSRS all groupings work correctly however when i export this report to excel the proper rows are grouped but the grouping is inverted (i.e. the last item in the grouping has the '+' sign instead of the parent, top row)
thanks for any help in this matter!
In SSRS, when exporting to Excel, if the report item that controls whether another item is toggled is not in the previous or next row or column of the item being toggled, the outline is disabled also. See:
https://msdn.microsoft.com/en-us/dd255234.aspx
This can happen if you have your total added after the group rather than before.
(right click on the group and click add total before)
However, we really need more details/screenshots to see what the cause might be.
The drilldown in SSRS has more features than the grouping in Excel can handle so sometimes it is not possible to get in excel what you have in your report..

Center multiple rows across selection

I am creating a slew of reports in Excel using VBA. I hide all columns that are after the used columns. I would like some of the rows to center across the visible columns.
For example, assuming the last column of the report is in column I, I hide J:IV (in Excel 2003). I want one section of the report with data in column A to center across A:I. Can I do that using VBA without looping through each row?
I assume the best way to get the last visible column is with .End(xlRight) (correct me on that if I am wrong, please).

Speed up the deletion of duplicates

I coded a VBA script in Excel which adds new data into a Datasheet with previous information. Before doing that, the new data is copied into a provisional Datasheet. To prevent duplicates, I create an additional column and do a VLOOKUP of IDs. If the ID from the new imported data is already in the Datasheet with the old data, this row is marked as duplicated and will be deleted. The "non-duplicated rows" are then copied into the final Datasheet, where all the data is stored.
Right now I use a column reference (A:A) in the VLOOKUP and I donĀ“t know if maybe this is the reason why the VBA script needs every day more resources and time to run. When I coded for the first time, I did the test with no more than 4,000 rows in the original Datasheet and 4,000 rows in the imported data. The macro was done after 90 seconds. Right now, it needs more than 5 minutes and the Datasheet with data is just 40,000 rows large, while the new data is always around 4,000 rows.
Should I dynamically reference the range in the VLOOKUP instead of using A:A or it doesn't matter in terms of speed?
As mentioned in my comment, there certainly is a way to accomplish this task using VBA, but sometimes the simpliest solution is best. I would reccomend added all 40K records each time and using the "Remove Duplicates" function under the "Data" ribbon using the column that holds your unique value.