I have a sheet of vendors and their contact info. I would like people in my department who have access to this sheet to be able to use a dropdown list to View All Vendors or View Vendors by Field. So far I have successfully used the different vendor field selections in a data validation list combined with the macro below to filter the information by vendor field. However, the people accessing this are not computer savvy and to return to viewing all the vendors, disregarding their fields, you have to click on the cell containing the list and click keyboard key "Delete" to cancel the macro. I am new to Excel and am assuming that in the macro "If Target.Count > 1 Then Exit Sub" means if the cell is blank then cancel the filter.
I would like a way to have an option/selection in my data validation list of vendor fields say "View All" or just "ALL" which when selected would cancel the macro or somehow with some formula show all the vendors regardless of their field.
Option Explicit
' Developed by Contextures Inc. <--http://www.contextures.com/excelfiles.html#Filter
' www.contextures.com <-http://www.contextures.com/AdvFilterSearchWord.zip
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Address = "$D$2" Then
Range("DatabaseUse").AdvancedFilter _
Action:=xlFilterInPlace, _
CriteriaRange:=Range("Criteria"), Unique:=False
End If
End Sub
I would like a way to have an option/selection in my data validation list of vendor fields say "View All" or just "ALL" which when selected would cancel the macro or somehow with some formula show all the vendors regardless of their field.
Option Explicit
' Developed by Contextures Inc. <--http://www.contextures.com/excelfiles.html#Filter
' www.contextures.com <-http://www.contextures.com/AdvFilterSearchWord.zip
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Address = "$D$2" Then
Range("DatabaseUse").AdvancedFilter _
Action:=xlFilterInPlace, _
CriteriaRange:=Range("Criteria"), Unique:=False
End If
End Sub