VBA AutoFilter

beginvbaanalyst

Board Regular
Joined
Jan 28, 2020
Messages
139
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

I'm currently trying to find a way to auto filter my A column with data from my O column. The data will always change and will never be the same.
1596050376266.png


I already have it auto filter from another tab (Column2) but I just want to find a more efficient way to check my sourced vendor column.
Which is where the autofilter from my O column will come in to make it easier when finding my sourced vendor.
I just don't want to have to click on each article one at a time when filter, that's not efficient at all.
How would I do this?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Try this:

VBA Code:
Sub PivotList()

Dim PT As PivotTable
Dim PTItem As PivotItem
Dim List As String
Dim rownum As Long

rownum = 2
Do Until Cells(rownum, 15) = ""
List = List & " " & Cells(rownum, 15)
rownum = rownum + 1
Loop

Set PT = ActiveSheet.PivotTables("PivotTable1") ''update as needed

For Each PTItem In PT.PivotFields("Article").PivotItems
    If InStr(List, PTItem) > 0 Then
    Debug.Print InStr(List, PTItm)
        PTItem.Visible = True
    Else
        PTItem.Visible = False
    End If
Next PTItm


End Sub
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,525
Members
448,969
Latest member
mirek8991

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top