Removing Blanks From Pivot Table Slicer Within Macro

Feb 20, 2014

I created a macro to create the beginning of a pivot table- just the rows and slicers, because when I tried making a longer macro to create the entire pivot table (formatting, etc) I couldn't get the macro to work.

So I do get all the vertical rows I want, and I do get all the slicers I want. But I get blank space. I think this is because the pivot table is created from another tab, and the length of data in that tab will vary from file to file (I'm doing another 30 or so of these, all with varying amounts of data, but the same data categories).

Anyway, I get slicers, but in addition to getting the categories I want, I also get "(blank)" below the names in the slicers. Is there a way to add some code to the macro to remove the blanks so I don't get this field?

I have copied and pasted the macro below, with identifying data changed.

View 4 Replies


Group Dates In A Pivot Table Slicer

Dec 31, 2013

I am currently working with a pivot table someone else created. The data set has dates only, in the correct format. The slicer has the dates categorized by month and excludes the dates in which there was no data.

Here is my problem: I added a few new months of data. Everything is calculating just fine in the Pivot table. However, my slicer where I should be able to pick the month now has these months listed as all their individual dates. I want to put the December dates under "December" and so on. The data that was present before I loaded anything additional still has this feature.

How do I group these dates, to be able to them as months? By the way, the grouping function is grayed out.

View 3 Replies View Related

Create Column List Out Of Table (rows And Columns) While Removing Blanks

May 26, 2014

I am trying to create a straight column list that can take the rows and columns of a table, and list only the nonblank items. The formula I am using only seems to work with one column, not multiple.


[Code] .....

View 12 Replies View Related

Hiding Blanks In Pivot Table

May 9, 2012

I have a macro that produces pivot tables, hiding the blanks in the process. It has failed today for the first time, which I think is because there were no blanks, so nothing to hide....

How can I fix the code so blanks are hidden only if necessary...

With ActiveSheet.PivotTables("PivotTable1").PivotFields("Email or Call")
.PivotItems("(blank)").Visible = False
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("wk_range")
.PivotItems("(blank)").Visible = False
End With

View 1 Replies View Related

Updating Pivot Filter With Another Pivot Updated By Slicer

Jul 17, 2014

I have this problem which I have simplified below:

Sheet 2 contains a Pivot table. One of the report filters is "Month-Year" (Eg, May-14 - in date format 'mmm-yy') which is selected by a Slicer on sheet 1.

Cell D1 on Sheet 2 contains a formula which calculated/displays the mmm-yy of the same period last year (eg May-13).

I want a code so that when I select the 'Month-Year' Slicer to filter the pivot table on Sheet 1 (eg to May-14), another Pivot on Sheet 3 is filtered with the previous year mmm-yy (May-13).

View 5 Replies View Related

Excel 2007 :: No (blanks) In Pivot Table?

Sep 26, 2011

I cannot remember how/if I can ALWAYS exclude blank results from my pivot table.

I'm hoping i don't need to use a macro, it should be in the settings for the pivot table, I hope...

I use Excel2007.

View 2 Replies View Related

Creating Single Column List From Multi-row / Column Table And Removing Blanks

Mar 7, 2014

I'm trying to come up with a single formula to create a single column list from a table with blanks.






I know I've done this before but having trouble visualizing today.

View 14 Replies View Related

Excel 2010 :: Count Non-blanks In Pivot Table

May 23, 2012

I have a simple pivot table that is types by state. I want to know how many types are in each state. In the attached image the answer for Alaska is 5, for Arizona 5, for Arkansas 1, etc. How do I get Excel to tell me that for each state?

I'm using Excel 2010. I have PowerPivot installed but really don't know how to use it yet.

View 7 Replies View Related

Removing Data Rows From Pivot Table

Jul 12, 2012

I have a workbook with a Pivot Table full of user data and security reports. The table is structured in a way that shows, numerically; each username and how man roles are assigned. I need to remove the username/row combo's that are listed as 1 or less. Obviously if I simply highlight the fields I want to delete it won't work. How would I go about removing such rows?

View 2 Replies View Related

Removing Blank In Row Labels (Pivot Table)

Jun 25, 2013

How can I Remove the word "Blank" in Row Labels or change it as Blank or no data.

View 1 Replies View Related

Removing Calculated Field From Pivot Table Using VBA

Feb 5, 2014

I am trying to create a dynamic pivote table that can be update using a value in a cell. I can get everything updating and working correctly except I am unable to remove the one calculated feild from my pivot table. I am able to remove all other fields without problem. Code below: (lines 13 and 14 is the code that i cant get to work)

Private Sub CommandButton1_Click()
Dim dt As String
Dim dt2 As String
On Error Resume Next
dt = Sheets("Executive Summery").Range("M1")
dt2 = dt & "2"


View 5 Replies View Related

Removing Data Fields With Vba In Pivot Table

Feb 1, 2010

I have written code to add datafiels to pivot table but I need to remove the ones that are their prior to adding.

Does anyone have a technique using vba to do this.

View 9 Replies View Related

Formula That Is Similar To The Pivot Slicer?

Jan 31, 2014

I have a list box contains of customer name and I used that to set up formula based on your selection in the list box. However, I wonder if there is a way that can select multiple customers in the list box and it will add up all that customers from your multiple selection like in the pivot slicer. I don't know if we have any formula that can do that complicated thing.

View 2 Replies View Related

One Slicer For Multiple Pivot Tables With Different Data Source

May 2, 2013

I have multiple pivot tables with different data source. I wish to have one slicer which control all the pivot tables. I would have one common colum for all the pivot tables which is the one i wish to control for instance the person in charge. Note that all my pivot tables are from different data source. how to do it?

View 1 Replies View Related

How To Set Selected Slicer Or Filter Items On One Pivot Equal To Another

Sep 26, 2013

I have two pivot tables, both of which source the same sheet of data. Each record in the data has two fields, Region ID of person and Region ID of facility, that reference the same list of Region IDs via vlookup (it's just numbers 1-12). Either one or both can be blank. One pivot outputs counts by person Region ID, and the other, by facility Region ID.

Using a combination of nested IF statements and vlookups, I tried making a third Region ID field that could be used as a slicer to control both tables, but what I end up with is an undercount in one of the tables. The only thing that works so far to output the correct counts is having two separate slicers, the facility Region ID being the slicer for one and the person Region ID being the slicer for the other. If the end user wants to see counts for one Region ID, they have to manually set one slicer equal to the other. But what we want is just for the end user to be able to control both tables just by pushing a single number, Region IDs 1-12.

I can make one of the slicers hidden but then how do I get the hidden slicer to automatically select Region ID values equal to the nonhidden slicer? Alternatively, I could somehow program a combo box or list to control the two different slicers, then the slicers would be hidden and the user would see only the combo box/list. (I guess in either of these alternatives, I could just use a report filter instead of a slicer; either way, I still have to get items in one to automatically select based on the user's selected items in another).

FYI, some of the options I looked up involved PowerPivot, which I do not have access to. VBAs/macros are ok.

View 2 Replies View Related

Make One Slicer Mirror Filters Of Another Slicer

Mar 28, 2014

I' have two slicers that each control two pivot tables. The slicers both are for the same field ("Department") but I guess the pivot table structure differences don't allow me to simply have one control all four tables.

Since both slicers contain the exact same options from the same field on the same origin table, I would like to problematically ensure that when department "A" is selected on slicer1, it is also selected on slicer2. When departments "A, B, & C" are selected on slicer1, the same are selected on slicer2. When filters are cleared... you get the picture.

View 5 Replies View Related

Anchoring Pivot Chart And Slicer Without Locking Entire Worksheet?

Jul 19, 2012

I am trying to create a "dashboard" style report using a pivot table and pivot chart with slicers. All of these objects (table, chart and slicers) are in the same worksheet. However, the users of the report (read executive management) are not very Excel savvy and I want to protect the format of the report. So, I want to protect the sheet and only allow access to the Pivot table options. However, in order to make the slicers usable, it appears that I have to allow them to edit objects. This unfortunately means that they can then move those objects (the Slicers and Chart).

I am looking for a way to lock the slicers and pivot chart in position. I have already accounted for column width changes created by modification of the pivot table parameters by selecting the "Don't move or size with cells" option under PivotChart Tools > Size > Format Chart Area > Properties > Object positioning. This is the default/locked-out setting for the slicers.

View 7 Replies View Related

Copy / Move Slicer Linked Pivot Charts To New Workbook

Mar 15, 2013

I have a Reporting workbook I designed. There is a "Parent" workbook with the following design.

It has 6 Pivot Tables on a Sheet called "Data"

It has 6 Pivot Charts that were created from these tables on a page called "Summary"

These 6 Pivot Charts are all linked through a pair of slicers.

There is a "control" page which has instructions and buttons that trigger "Refresh All" and "Create Child Workbok".

This design is so that someone unfamiliar with excel could conceivably create the final product.

Essentially I have written/put together VBA to Create a new workbook "child" which has should be a funcitoning copy of the "parent".

The problem is the copiedmoved (I have tried both) Pivot Charts no longer update/refresh when the pivot tables change. I have script that reconnects the Pivot Tables to the Slicers. Slicers are fully funcitonal. Links in cells are fully functional.

Some of this code might look familiar.


Sub createWB()
' Copies VBA modules, Calls
Dim wbNew As Workbook, wbT As Workbook
Set wbT = ActiveWorkbook
On Error Resume Next
Kill ("PATHmod1.bas")
Kill ("PATHmod2.bas")


View 2 Replies View Related

Removing Blanks From Dropdown?

Jun 21, 2013

I have a dropdown in which a state can be selected. A second dropdown then retrieves and displays a list of the counties in that particular state that the user can choose from.

The available county list is retrieved using an array formula:
{=IFERROR(INDEX(RatingTables!$MF$8:$MF$3195, SMALL(IF(LandingPage!$G$20=RatingTables!$ME$8:$ME$3195, ROW(RatingTables!$ME$8:$ME$3195)-MIN(ROW(RatingTables!$ME$8:$ME$3195))+1, ""), ROW(B1))),"")}

and there are a variable number of counties in each state, so I have dragged the formula quite far down the column.

The problem is that because of this, my county dropdown has quite a few spaces at the end of its selection list (depending on the state). I've attemped to remove them using a dynamic table (the available counties populate in column R):

but it still includes the spaces at the end of the dropbox scroll list.

View 1 Replies View Related

Copy Cells To Adjacent Column, Removing Blanks

Dec 8, 2009

In a worksheet, J2:J52 contains a list of unique strings; each cell populated by an embedded formula. Some of the cells contain a valid 'blank' "" given by the formula.

I'd like K2:K52 to contain the values J2:J52, with all the populated cells stacked at the top and the 'blank' cells at the bottom. 'Blank' cells do not have to be in any particular order.

I've been fiddling with the formula kindly provided by WindKnife on the second post in the thread below for the past couple of hours, but to no avail:

Columns A:H in the same worksheet are populated and unavailable for use.

View 8 Replies View Related

Select Fields In Slicer With Macro

Apr 10, 2014

I have two slicers, say slicer 'F' that slices on fields 'x', 'y' and 'z' and slicer 'E' that slices on fields 'a', 'b', 'c'.

I select these values by using a very simple macro. For instance to select z in slicer "F", I have the following code:

With ActiveWorkbook.SlicerCaches("F")
.SlicerItems("x").Selected = False
.SlicerItems("y").Selected = False
.SlicerItems("z").Selected = True
End With

However, I want the selected fields to have more flexibility than which is possibly by coding them in VBA. Ideally, I would want to write the selected fields in a cell in Excel (also if there are more of them!), then let the macro retrieve these fields and use them to apply to the slicer. So I write in a cell slice on X and Z, the macro picks this up and performs this operation.

Is this possible?

View 1 Replies View Related

Excel 2010 :: Pivot Table Reference Is Not Valid When Moving Data And Pivot Table Together?

Mar 19, 2013

On a worksheet, I created:

- a list of data
- a pivottable based on these data

When moving this worksheet this worksheet to another workbook, the pivot table can't refresh anymore. This throws an error message "Reference is not valid". To work around this problem I need to adapt the datasource. The same occurs if the list and the pivot table are on separate sheet, with the added strange behaviour that, when data an PT are split, it is not possible to move both sheet together.

This would not be a big issue if my problem had to be solved manually. The real problem is that I need to move the sheets from a C# program.

View 3 Replies View Related

Split Up Huge Macro Using Call Macro But Pivot Table Code Errors Out?

Jul 10, 2012

I'm using a CALL Macro to split up a HUGE macro into different pieces:

'Macro recorded 12/14/2010 by Ryan R. Koleno, Pharm.D.
'Last Updated 7/10/12 by Ryan R. Koleno, Pharm.D.
'Do Not Modify Code Unless Given Proper Privileges to do so.
Dim APPSPD As Worksheet
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual


The first few macros dealing with page setup and what not work fine but when it hits the Pivot table code for the STATSPIVOT macro it errors out stating: "Run-time error '1004': Unable to get the PivotItems property of PivotField class' at this point in the code:

objField2.PivotItems( _
"TRC").Position = 1
objField.PivotItems( _
"MEDCO MAIL OR AOB").Position = 2

When this macro is not split up it worked fine as written. Am I overlooking something in the Call Macro's code or is there a variable I'm not aware of. I have included the Pivot Table code that errors out as well.

Sheets("STATS DATA").Select
Dim objTable As PivotTable, objField As PivotField
ActiveWorkbook.Sheets("STATS DATA").Select


View 4 Replies View Related

Create Pivot Table: Cannot Open Pivot Table Source File

Jan 4, 2010

I'm trying to write a macro that will create a pivot table, and am getting an Error code 1004: Cannot Open Pivot Table Source File "Sheetname". My code is below. I've tried to note what each section does, and it all seems to work well except for the Pivot Table creation.

View 14 Replies View Related

VBA - Adjust Pivot Table Included Fields To Match Another Pivot Table

Mar 14, 2013

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"

View 1 Replies View Related

Pivot Table Query: Make A Pivot Table To Summarise The Data

Jan 22, 2007

attached is a spreadsheet 6 people in my area use daily(ive copied and pasted the sheet in question to a new worksheet, as the file was too big). Ive been trying for about 3 days now to make a pivot table to summarise this data.

View 6 Replies View Related

Pivot Table Macro....

Jul 25, 2009

I have a pivot table macro below. It works great:

View 3 Replies View Related

Macro To Create Pivot Table?

Jun 3, 2014

Can record the all those actions which we need to do on a regular basis. In my work i have to create the pivot table to a data which gets changed every day but the data sequence remains the same.

I have tried to record the macro for the pivot table but when i tried to run the macro again then the below error message comes.

"run time error 5" "Invalid procedure call or argument" when i click on debug then the below macro program is highlighted in yellow color.

View 1 Replies View Related

Macro For Dynamic Pivot Table

Jun 23, 2014

I am trying to make a dynamic pivot table using VBA. Unfortunately, Im not very good.I have a set of data with variable number of rows and variable number of columns and I need to make a pivot table. Need to select this data from sheet - Master, where the first data entry starts in cell A1. of the data in the sheet, i only need the name and age title In the pivot table fields -

ROWS needs to contain - name
COLUMN needs to contain - Age
Values need to contain - count of Age

After this is done, since the data will be dynamic, the pivot table will also be dynamic. i need to copy the pivot table data and paste it in another sheet so that I can do some filtering. The filtering part I think i can do my self.

View 3 Replies View Related

How To Make Pivot Table Using VBA Macro

Aug 19, 2012

i want to make the pivot table using vba macro. the sample workbook looks likes this [URL]...

View 1 Replies View Related

Copyrights 2005-15, All rights reserved