Results 1 to 6 of 6

Thread: Selecting Slicer Items

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    VBAX Newbie
    Joined
    Mar 2018
    Posts
    1
    Location
    I could kiss you!!! i've been looking for this FOREVER!!!! THANK YOU!!!! but i want the first thing to be selected, so im going with

    Sub Update_Slicer_Date()
        Dim i As Long, n As Long    
        With ActiveWorkbook.SlicerCaches("Slicer_Day_of_Week")
            n = .SlicerItems.Count        
            For i = 2 To n - 0
                .SlicerItems(i).Selected = False
            Next i        
            .SlicerItems(n).Selected = False
        End With    
        With ActiveWorkbook.SlicerCaches("Slicer_Day_of_Date")
            n = .SlicerItems.Count        
            For i = 2 To n - 0
                .SlicerItems(i).Selected = False
            Next i        
            .SlicerItems(n).Selected = False
        End With
    End Sub
    Quote Originally Posted by Paul_Hossler View Post
    To select the last Slicer item, try something like this

    Sub test()
        Dim i As Long, n As Long    
        With ActiveWorkbook.SlicerCaches("Slicer_Account")
            n = .SlicerItems.Count        
            For i = 1 To n - 1
                .SlicerItems(i).Selected = False
            Next I        
            .SlicerItems(n).Selected = True
        End With
    End Sub
    Last edited by Aussiebear; 03-10-2025 at 07:18 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •