

Start by selecting both columns and under the #PowerAutomate – Get a copy of an invoice from your E-conomic system Let’s imagine your data contains two columns with year and the month name and you want to create a date column. Here is another example that might help you. Sometimes it’s the little things that can help you minimize the number of steps in your Power Queries. You could also use sl.Name to return the slicer's name, or sl.SourceName to return the source name.#PowerQuery – Create a date column from Year number and a month name Sl.Caption is the code to return the slicer's header caption. The macro then loops through each slicer in the slicer cache, and prints the slicer's caption and parent worksheet name to the Immediate Window. Checkout this Office Blog article for more details on how the slicer cache works. Slicers that are connected to the same pivot tables will share the same slicer cache. The number of slicers in the cache depends on the connections to the pivot tables. The slicer cache contains a collection of one or more slicers. The macro above loops through all the slicer caches in the workbook.

'sl.Caption = slicer header caption 'sl.Parent.Name = worksheet name Next sl 'Description: List all slicers and sheet names in the Immediate window 'Author: Jon Acampora, Excel Campus 'Source: Dim sc As SlicerCacheįor Each sc In ActiveWorkbook.SlicerCachesĭebug.Print sl.Caption & " | " & sl.Parent.Name This code could be modified to add the list to a range in a worksheet. The list is printed in the Immediate window of the VB Editor (Ctrl+G). The following VBA macro will create a list of all the slicers in the active workbook, and the sheet that the slicer is on.
