I'd like to show in the chart below as title the selection from the slicer. I see two possbile options:
Select the unique row from the table below where the data is from. I've tried Unique function, but it gives me all the unique items from the table, rather than only the selected item
Possible vba code to save the value from the slicer and save in a speficic cell?
Related
I am trying to display a ComboBox with the names of the Doctors of a table with two columns, NAME and TYPE. The TYPE can be DOCTOR or AUX.
I think I should start with:
ComboBox.RowSource = "TableName[TYPE]"
I would like to know how to tell them only to display the Doctors.
There is no way to filter the RowSource directly. You need to apply a autofilter to your table. Then copy the filtered result into a (hidden) temporary sheet and use that as RowSource.
Alternatively you can loop through the filtered table and fill the combobox item by item with VBA.
I have a slicer containing values from 0.00-1.00, connected to a pivottable.
I would like to have a scrollbar to control these slicer values instead of having to select them individually.
I have looked into the timeline option, but that obviously only applies to dates, which I can't use.
The second option I have been trying is the ActiveX controll scrollbar. I thought I'd then use the scroll bar as a maxium value for the slicer, but I don't know if it's possible to connect the slicer to a cell?
I ended up adding the slicer content as an extra row in the Pivottable and then recording a macro where I filter the content to some arbitrary values.
I then adjusted the macro to reference the cell values linked to the scroll bar.
This has to do with Pivot Tables.
I am trying use VBA (or C#) to get to some data that's stored in the spreadsheet, but I don't know where it is in the object model. I know the data is in the spreadsheet because when I unzip the spreadsheet, I see it in the pivotcache. The following documentation for OpenXML talks about the field in particular:
https://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.rangeproperties%28v=office.14%29.aspx
In the RangeProperties class, see the groupInterval property, in particular.
For instance, the XML shows:
<fieldGroup base="0">
<rangePr startNum="19" endNum="947" groupInterval="656"/>
<groupItems count="4">
<s v="<19"/>
<s v="19-684"/>
<s v="685-1350"/>
<s v=">1351"/>
</groupItems>
</fieldGroup>
But I don't know how to get to this from the Excel object-model at runtime.
The above data represents the entries the user makes in order to group a set of rows in a pivot table. Below are more details on how to get to it.
When you click on Rows of a Pivot Table, you can Group the rows. For instance, let's say you have a thousand rows, but the values range from 1-100. You don't want to see all 1000 rows, just in 10 rows (groups of 100). First group will be a row that aggregates all the rows where the value is between 1-100, the next group for values 100-200, etc.
When you right-click any cell the Row Labels section, and click on the Group item from the context menu, you'll get a small dialog box with "Grouping" in the title bar, and fields:
- Starting at:
- Ending at:
- By:
And there will be a checkbox next to the starting at and ending end fields.
I'll take the defaults, and increment by 100
The equivalent to doing this in VBA (or C# VSTS) is:
Select the cell:
Call the Group() method on the current single-cell selection, eg:
Selection.Range.Group true, true, 100
At this point, the PivotItems associated with the PivotField end up with captions such as "1-100".
Now, if you right-click on the field again and select the Group item, you will get the same dialog box pop-up, with the fields of the dialog box filled in with the previous values you selected for that PivotTable.
However, the information that's used to fill that dialog box doesn't seem to exist anywhere in the object model. I suspect I just don't know where to look.
Does anyone know?
So the basic question in is, when I call the Group method on a single-cell Range object, and pass in various parameters, where are those parameters retained in the object model? I know it's there because Excel itself is able to load it up and it's stored in the spreadsheet.
I want to control the pivot chart filter by simply using combobox form control without using any type of macro.
Here is a screenshot :
In the above screenshot. I have a combobox containing Name later on I will populate this combobox with the distinct name. My concern is how I can control the pivot chart filter by changing the combobox selection.
FYI
datarange of pivot chart is full name and status column.
Report Filter is name column.
Axis Fields(Category) and Values are column Status
Note: I don't want to use macro for this.
Any help will be appreciable.
I'm using Office 2013, and working on a worksheet in Excel.
My question is, is there a way to create a dynamic filter in Excel?
To explain in more detail, I have a dynamic worksheet, where upon opening the user will get a few drop-down options. After the user has selected one option from each of the drop-downs, the worksheet will display a table of data based on the user's inputs. The user can change their selections from the drop-downs after the table has been displayed, and can also clear their selections. If they clear their selection, the table will disappear.
Now, the first column in the result Table will contain Text values, but can also contain blanks. These values or blanks are all decided based on the user's selections in the previously mentioned drop-downs, which are displayed permanently to the left of the table. I want to add a filter to this first column of the result table (and to the rest of the table with it) such that only the non blank cells are displayed in the table every time the drop-downs are changed.
As I understand your need correct, I can give you this solution:
For getting a better result make your range to Table.
Select Power View from Insert items;
A sheet Power View 1 will added to your workbook;
From right pane select Table1 and its fields;
From Filter pane select as you want for filtering.