nameuser321
04-11-2012, 04:53 PM
This is the function that I'm trying to figure out. Can't use the criteria part of this sub because i can't use (*) when looking at a number. trying to get make visible even partial zip codes that meet this criteria. Just blanks everything out at this point. My Question is is there a way to treat the zip code like a string without entering some character in the cell ("z_77043"), which i kind of just don't want to do, or is there a better way to make visible partial zip codes?
sub test()
dim aRange as range
Set aRange = ActiveSheet.Range("A1")
AutoFilterMakeVisible aRange, "ZIP", "=*77*"
end sub
Sub AutoFilterMakeVisible(dRef As Range, rangeName As String, aCriteria As String)
Dim interRange As Range
Set interRange = dRef.Parent.Names(rangeName).RefersToRange
interRange.AutoFilter interRange.Column, aCriteria
End Sub
sub test()
dim aRange as range
Set aRange = ActiveSheet.Range("A1")
AutoFilterMakeVisible aRange, "ZIP", "=*77*"
end sub
Sub AutoFilterMakeVisible(dRef As Range, rangeName As String, aCriteria As String)
Dim interRange As Range
Set interRange = dRef.Parent.Names(rangeName).RefersToRange
interRange.AutoFilter interRange.Column, aCriteria
End Sub