I'm using customer reference numbers to filter data in a table. Can I filter off rows depending on their customer reference number using a VBA code?
I'm employing a very useful code I saw online that contains information based on a client reference number and looks like this:
Dim rgData As Range, rgCriteria As Range, rgOutput As Range
Set rgData = ThisWorkbook.Worksheets("Sheet 1").Range("A1").CurrentRegion
Set rgCriteria = ThisWorkbook.Worksheets("Sheet 1").Range("I1").CurrentRegion
Set rgOutput = ThisWorkbook.Worksheets("Sheet 2").Range("A1")
rgData.AdvancedFilter xlFilterCopy, rgCriteria, rgOutput
The code first includes just the customers discovered in the table on sheet 1 that begins in cell "I1," then it moves on to sheet 2 and only includes customers in the table that begins in cell "A1" who have customer reference numbers.
Is there a way that I could change the above code so that it excludes those customer reference numbers found in the table in cell "I1"?