I have been having issues with some excel fields not showing up in my pivot table pull downs.
For example I entered the date 6/8/97 into a field in my database and after I hit refresh on my pivot table that specific date doesn't show up in the Date field list pull down. It is like the pivot table doesn't even see that date and/or it is recognizing it as another date. I have this same issue w/ other field lists (eg. last names).
Im using the following VBA code, but the on error resume does nothing, excel throws out the error 1004 "Unable to get the pivotfields property of the pivottable class" (i know why the error is caused and how to fix it but my error trapping wont work). Is there some option which i have turned off which prevents me from trapping errors?
Dim ws As Worksheet Set ws = Excel.Sheets("Sheet1") On Error Goto err: If ws. Range("IV1").Value = "dog" Then ws.PivotTables("PivotTable1").PivotFields("Price Euros").Orientation = xlHidden Else ws.PivotTables("PivotTable1").PivotFields("Price Dollars").Orientation = xlHidden End If
I have a worksheet with two pivot tables, one of which is visible to the user. Ideally, the user should be able to change the "Row Label" field settings of the visible pivot table and then press an "update button" that then adds the same field to the second pivot table.
Ideally, the ordering of the fields should also be made similar between the two tables, though this is of less priority.
I imagine it would be something in the style of:
"If number of Pivot1 active row label fields = X then Pivot 2.AddRowLabelField = Pivot1.RowLabelField(X) end if"
I am trying to find a way to count the total number of pivot fields in a pivot table so I can remove ghost pivot items that are no longer in the pivot table data. My code for this subroutine is as follows;
Sub RemoveGhostPivotItems() Dim ghost As PivotItem Dim pt As PivotTable Set pt = ActiveSheet.PivotTables(1) pt.ManualUpdate = True For Count = 1 To 10 On Error Resume Next For Each ghost In pt.PivotFields(Count).PivotItems ghost.Delete Next ghost Next Count pt.ManualUpdate = False End Sub
My code makes an assumption that I have 10 Pivot Fields or less. It would be nice to actually know the number of Pivot Fields so my "For Count" Loop would be more efficient. In otherwords;..............
I have a question regarding pivot tables. how do I hide a field but still maintain that filter? I have a field in the Column Fields titled "International". Right now I've filtered out only the YES entries, but I don't want to see a "YES" column beside each. When I try to hide the column the filter is reset and all entries, international or not, are seen. Can I hide the column but maintain its filter?
I was wondering if it were at all possible to add multiple columns to the values portion of a pivot table at once, instead of individually dragging. When you click on them, it auto-sends them to Row Labels, which I don't want. I have a bunch of colums I want to add to Values and don't want to waste a bunch of time dragging them individually.
My data has a field for "Donor Type." There are about 2 dozen types of and about half of them start with the letters CF. When I do a pivot table, instead of getting 2 dozen rows of data I'd like all the CF donors to be in the same row. Is there a way to do that without changing my data? Some sort of filter or grouping within the pivot table?
I have fields "Day", "Posts", "Impressions" in a pivot table and I need to create a new metric for the average Impressions per Post. Ideally, this new metric should function just like the other fields in the pivot table, and not just static, because I'd like to break it out not just by Day, but also Time, etc.
Day Count of Posts Sum of Impressions Impressions Per Post
I have a sheet that has drop-downs with totals affiliated with each option. This is a time recording sheet and I would like for each drop-down type to be totaled accordingly. Any help with an equation would be greatly appreciated.
If you have any suggestions, I can send you the document for review.
Is it possible for data like "ABC /sdfsd/sdfs/sdf/sdf/sdf/" to be viewable in a drop down but when selected to appear only as "ABC" in the spreadsheet? I need to be able to see the full line of data when selecting my choice from the drop-down but for readability-sake in a printable spreadsheet only want "ABC" to be displayed.
can you have col A contain a drop down and then column B include an if then statement that would result in another drop down? IE. Column A has drop down with options of "A", "B", and "C", if the user selects "A", then a drop down would appear in column B containing options "1", "2", and "3". But if the user selects "B" in column A, then a different drop down appears in Column B with options "Yes", "No", and "Maybe"...etc....
First post so please excuse me if this has been covered before but I am trying to get the results of a dropdown menu in one worksheet to become the criteria for a filter in another worksheet (both in teh same workbook).
I thought I could just add a reference to the dropdown cell into the autofilter (in VBA editor) but it doe't seem to be that simple.
trying to shred the last bits of fat for the summer and thought I'd try a Keto diet, this depends heavily on not eating very many carbs, as well as keeping your total Kcal intake below maintenance.
This makes for a fairly tricky diet, as most things you generally eat contains alot of carbs, so I thought I'd make planning my meals easy, by creating an excel sheet, with drop down menues for different foods/drinks as well as their nutritional content.
I''d like it to look something like this, with the dropdown list under "Food" ....
I have an analytics sheet where I have a client name chosen from a drop down via validation. The problem I am running into is that while I want information from a data table to populate a cell based on the selection from the validation, I also want the cell to populate based on a second drop down box (basically selecting a time frame). Take the example data table below:
Client Jan 2009 Jan 2009 Target etc etc Client A 1111 1290 Client B 900 750
I would like the user to be able to select Client B and then, from a separate drop down, also choose, say, Jan 2009 Target and then another cell would populate with, in this case, 750.
Basically I've jumped straight in and have tried to recreate a report I need to produce which requires a pivot table. I have managed to create the code I need to produce a pivot table in a new sheet with all of the headers available for analysis. Where I'm struggling is in getting the pivot to show the datafields correctly.
The list that I am creating the pivot from has about 30 headers. 20 or so are analysis fields with the remainder being various figures; monthly plan, monthly actual, monthly variance etc..
The pivot table I need to create needs all analysis fields available to the end user for manipulation, which I have managed to do. I have created rows for sales areas, also with no problem. It also needs the above plan, actual and variance fields in columns and as datafields. This is where I'm having trouble. When I create the pivot manually it ends up with 1 row and 3 separate columns with summed data in each. I have checked the VBA code, copied it and used it again. The pivot table comes out with 1 row but with the data fields stacked one on top of each other. Any minor alterations that I can think of, (for example adding a position = 1, position = 2 etc.), either creates a chaotic looking sheet or an error.
I've checked various posts on pivot tables but am having trouble understanding the way in which I can correct this. Is there a straightforward command that I'm missing? Do I need to start declaring variables for pivot items?
I'm trying to create a pivot table, but there is a problem. Although my data only has 2 years (1996 and 1997), it creates a new year it calls "blank," and a lot of the data that is supposed to be under 1996 and 1997 appears under this "blank" year. How do I fix this? See the attachments for the data and pivot table.
I have pivot tables in diff pages im trying to make a button to reset all the fields in all the pivot tables..
i tried recording a macro to do this but it only works for page fields.. it wont work for the column fields.. act, adopt and check are page fields at the top... region is a column field ... goto_AQcheck is a macro to switch to that sheet which is assigned to another button....
I am trying to use a summary field in the pivot table in a new calculated filed, but am unable to do so. Let me first describe the context so its easier to understand:
I have a collection of customer purchase records, which look like the following:
Customer Name, Customer ID, Purchase Amount, Activation Date ------------------------------------------------------------- John , 100 , $150 , 2011-04-01 17:07:50.0 John , 100 , $250 , 2011-04-01 17:07:50.0 Paul , 101 , $125 , 2011-08-20 11:10:27.0
I have several 1000 records like the above and I need to create a summary report which looks like:
Customer Name, Total purchased, Activation date, Avg monthly purchase ----------------------------------------------------------- John , $350 , 2011-04-01 , $175
The average monthly purhcase needs to be calculated based on the date of report generation. So in the case above, the average is calculated as of 2011-06-01.
In order to generate the report above, I created a pivot table with "Customer Name" in the "row labels" section and "Pruchase amount" and "Activation date" in the "values" section of the pivot table. When I try to calculate the "Avg Monthly Purchase", I'm running into the following problems:
1. The activation date is not being displayed as a date, but instead shows 0, when I set the value field settings to "Min"
2. I tried to create the "Avg Monthly Purchase" as a Calculated Field and then use the "Sum of Purchase Amount" field that the pivot table calculates. However, I'm unable to reference the "Sum of Purchase Amount" field in the calculated field.
I have a pivot table listing different company names in the first column under 'row labels' and there are calculated fields, a count and an average in columns B and C respectively. Is it possible to insert another field in column D that calculates the difference between values in column B and C (even though they are calculated fields themselves)?
Worksheet A contains two columns, that maps individual operations to their unitary cost: COLUMN 1 = a list of operations COLUMN 2 = the cost associated with each operation.
I can do a vlookup on this worksheet to retrieve the cost of each individual operation.
On another worksheet, I have a pivot table with a field that produces the sum of operations performed by type of operation, eg.
operation 1 was performed 5 times operation 2 was performed 7 times operation 3 was performed 4 times
I want to add a calculated field in the pivottable, that would output the total cost per operation. The formula for the calculated field in thepivot table would be = operation * vlookup("name of operation","range for lookup table",2,0)
... unfortunately, "references, names and arrays are not supported in pivottable formulas".