Sub topic 5
Resizing, Arranging Columns, and Applying Styles
This chapter covers how to change the look and size of a slicer so it fits your report. It assumes you can already insert a slicer, select items in it, and clear its filter. It also assumes you know the ribbon's contextual tabs, which are tabs that appear only when a certain object is selected. Settings such as the caption and sort order are covered in the next chapter.
Why formatting matters
A slicer that works but looks wrong causes real problems. A tall slicer pushes other controls off the screen. A slicer with a long list of items and one column forces the user to scroll. A default blue slicer next to a report with a green theme looks out of place. Formatting fixes these issues without changing what the slicer filters.
All formatting happens on the Slicer tab of the ribbon. This tab appears when you click a slicer. If you cannot see it, click the slicer's title bar or border once. On Excel for Microsoft 365 the tab is named Slicer. In older versions it is named Slicer Tools > Options.
Selecting a slicer without changing the filter
Clicking inside a slicer on an item changes the filter. To select the slicer itself, use one of these methods:
- Click the slicer's title bar (the caption at the top).
- Hold Ctrl and click anywhere on the slicer. This is the safest method because it never toggles an item.
- Right-click the slicer and press Esc to close the menu. The slicer stays selected.
To select several slicers at once, hold Ctrl and click each one. You can then resize or align them as a group.
Resizing a slicer
A slicer has a height and a width. You can set them in two ways.
- Drag the handles. Select the slicer and drag a corner or an edge handle. This is quick, but the result is imprecise.
- Type exact values. On the Slicer tab, find the Buttons group and the Size group. Enter values in Height and Width. The values are in centimeters or inches, depending on your regional settings.
Typing values is better when you have several slicers that must match. Select them all with Ctrl+click, then type one height and one width. Every selected slicer takes the same size.
A slicer has a minimum size. If you type a value that is too small, Excel raises it to the smallest size the slicer can have. This limit depends on the caption and the button settings.
Button size
The items in a slicer are drawn as buttons. In the Buttons group you can set the Height and Width of each button separately from the slicer itself. Button size matters because the slicer shows only as many buttons as fit in its frame. If the buttons are tall, fewer of them are visible and a scroll bar appears sooner.
The button width is tied to the number of columns, which is the next topic.
Arranging items in columns
By default, a slicer lists its items in one column. A field with 12 months or 20 product names then needs a long, narrow slicer. Setting more columns turns it into a grid.
- Select the slicer.
- On the Slicer tab, find Columns in the Buttons group.
- Type a number or use the arrows.
The items fill the grid left to right, then top to bottom. With 12 months and 4 columns you get 3 rows. With 12 months and 6 columns you get 2 rows.
Excel divides the slicer's width among the columns. If you increase the number of columns without widening the slicer, each button becomes narrow and long item names are cut off. The usual routine is:
- Set the number of columns.
- Widen the slicer until the longest item name fits.
- Adjust the slicer height so all rows show without a scroll bar.
| Goal | Columns | Slicer shape |
|---|---|---|
| Short list, like 4 regions | 1 | Narrow and short |
| Twelve months | 3 or 4 | Medium width, 3 to 4 rows |
| Twelve months in a single strip | 12 | Very wide and short |
| Long list, like 40 products | 1 | Tall, with a scroll bar |
A horizontal strip of buttons works well above a report. A vertical list works well on the side. Choose the shape that matches where the slicer will sit.
Applying a slicer style
A slicer style is a saved set of colors for the title, the selected items, the unselected items, and the items that have no data. Styles change only the look. They never change which items are selected.
To apply one:
- Select the slicer.
- On the Slicer tab, open the Slicer Styles gallery.
- Hover over a style to preview it, then click to apply it.
The gallery has light styles, which have a pale background, and dark styles, which have a dark background. The colors come from the workbook's theme. If you change the theme on the Page Layout tab, the slicer colors change to match. This is why a slicer may look different after you copy it to a workbook that uses another theme.
What each part of a style controls
A style has separate formats for each part of the slicer. Knowing the parts helps you read the gallery and create custom styles.
| Part | What it is |
|---|---|
| Whole Slicer | The outer frame and background |
| Header | The caption area at the top |
| Selected Item with Data | A selected item that has matching records |
| Selected Item with No Data | A selected item with no matching records |
| Unselected Item with Data | An item that is not selected but has records |
| Unselected Item with No Data | An item that is not selected and has no records |
| Hovered variants | The same items while the mouse is over them |
The "No Data" parts matter when the slicer is connected to a filtered report. Items with no data are shown in a faded color by default, so users can see at a glance which choices are not available.
Creating a custom style
If no built-in style fits, you can make your own.
- Right-click any style in the Slicer Styles gallery and choose Duplicate, or open the gallery and choose New Slicer Style.
- Give the style a name.
- Select a part from the list, such as Header, and click Format.
- Set the font, border, and fill. Click OK.
- Repeat for the other parts you want to change.
- Select Set as default slicer style for this document if new slicers in this workbook should use it.
A custom style belongs to the workbook where you made it. It does not appear in other workbooks. To reuse it, copy a slicer that uses the style into the other workbook. The style comes with it.
Built-in styles cannot be edited. Duplicate one first and change the copy.
Aligning and arranging several slicers
Once slicers have the same size, line them up. On the Slicer tab, the Arrange group has these commands:
- Align: Left, Center, Right, Top, Middle, and Bottom. These align all selected slicers to one edge or line.
- Bring Forward and Send Backward: Control which object is on top when objects overlap.
- Selection Pane: Shows a list of all objects on the sheet. You can rename slicers, hide them, and reorder them. This is useful on a sheet with many objects.
- Group: Combines several slicers so they move and resize together.
To space slicers evenly, select three or more and use Align > Distribute Horizontally or Distribute Vertically.
Position and cell behavior
By default, a slicer moves and resizes with the cells under it. If you hide a column or change a row height, the slicer can change shape. To prevent this:
- Right-click the slicer and choose Size and Properties.
- Open the Properties section.
- Choose Move and size with cells, Move but don't size with cells, or Don't move or size with cells.
For a dashboard where you hide helper columns, Don't move or size with cells is the safest choice. On the same pane you can select Locked, which has an effect only after you protect the sheet. You must also allow users to edit objects on the protected sheet, or they cannot click the slicer.
Showing or hiding the header
The header holds the caption and the Clear Filter button. In the Slicer Settings dialog you can hide the header, which saves vertical space. Hiding it also removes the Clear Filter button, so users must use Alt+C or the keyboard to clear the filter. Hide the header only if you provide another way to reset the report. The caption itself is covered in the next chapter.
Example: three matching slicers
Suppose a sales report has slicers for Region, Category, and Year. You want them in a row at the top.
- Insert the three slicers. They appear stacked on top of each other.
- Ctrl+click each one to select all three.
- On the Slicer tab, set Height to 3 cm and Width to 5 cm.
- Set Columns to 2 for Region and Category if they have four or more items. Set Year to 1 column if it has three years.
- Apply the same slicer style to all three while they are still selected.
- Drag the leftmost one to the left edge, then use Align > Align Top and Distribute Horizontally.
Because all three were selected together, steps 3 to 5 each took a single action instead of three.
Common mistakes
- Cut-off item names. The slicer is too narrow for the number of columns. Widen it or lower the column count.
- A scroll bar that should not be there. The buttons are taller than needed. Reduce the button height or raise the slicer height.
- Different colors after copying. The destination workbook has another theme. Apply a style again or copy a slicer with a custom style.
- Slicer squashed after hiding rows. The object property is set to move and size with cells. Change it to Don't move or size with cells.
- Cannot edit a built-in style. Duplicate it first.
Exercise
A slicer for the Month field has 12 items. It is 4 cm wide and shows one column, so a scroll bar appears. You want all 12 months visible in a compact block without a scroll bar. Which settings do you change, and in what order?
Show answer
Select the slicer without toggling an item, for example by holding Ctrl and clicking it. On the Slicer tab, set Columns to 4 so the 12 months form 3 rows. Widen the slicer until the longest month name fits on its button. Then raise the slicer height, or lower the button height, until all 3 rows show and the scroll bar disappears. Optionally apply a slicer style last.
Exercise
You built a dashboard with five slicers. After you hide a helper column beside them, two slicers become narrower. What property caused this, and how do you fix it?
Show answer
The slicers use the default object property Move and size with cells, so hiding a column shrinks anything that spans it. Right-click each slicer, choose Size and Properties, open Properties, and select Don't move or size with cells.