Forum Discussion

zerogenome's avatar
zerogenome
Copper Contributor
Nov 29, 2019
Solved

How to link combobox.listfillrange to pivot table field (VBA)

There are 2 worksheets related to this problem. First is a worksheet call "UI_Testing" which contains my problem. (Combobox name "ComboBox_CategoryType") Second is "ModeListing" where my pivot ta...
  • JKPieterse's avatar
    Nov 29, 2019

    zerogenome I added this code to the worksheet "ModeListing":

    Private Sub Worksheet_Activate()
        Dim PT As PivotTable
        Set PT = Me.PivotTables(1)
        With PT
            .RefreshTable
            .RowRange.Offset(1).Resize(.RowRange.Rows.Count - 2).Name = "CatList"
            Worksheets("UITesting").ComboBox1.ListFillRange = "=catlist"
        End With
    End Sub

Resources