Sub test()
Dim i As Long, x As Integer
Dim myRng As Range
Dim criteria As Variant
Sheets("Sheet3").Activate
'range of data, not including header row (data starts in row 2)
'Set myRng = Range("A2", Range("A65536").End(xlUp))
'check each item in "Town" list, add to Criteria variable
'With myRng.Columns(1)
' criteria = .Cells(1).Value
' For i = 2 To .Rows.Count
' If TextExists(.Cells(i).Value) = False Then
' criteria = criteria & "," & .Cells(i).Value
'Debug.Print criteria
'End If
'Next i
'End With
criteria = "Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Georgia,Hawaii,Idaho,Illinois,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Maryland,Massachusetts,Michigan,Minnesota,Mississippi,Missouri,Montana,Nebraska,Nevada,New Hampshire,New Jersey,New Mexico,New York,North Carolina,North Dakota,Ohio,Oklahoma,Oregon,Pennsylvania,Rhode Island,South Carolina,South Dakota,Tennessee,Texas,Utah,Vermont,Virginia,Washington,West Virginia,Wisconsin,Wyoming"
criteria = Split(criteria, ",")
With Rows("1:1")
.AutoFilter 'turn on autofilter
For x = LBound(criteria) To UBound(criteria)
Sheets("Sheet3").Activate
'filter "State" column using criteria
.AutoFilter field:=1, Criteria1:=criteria(x)
'With myRng.SpecialCells(xlCellTypeVisible)
'***instead of this portion of code, try replacing it with a call to your Export macro
Call Export(criteria)
'End With
'**********
Next x 'display filter results for next item
.AutoFilter 'turn off autofilter
End With
End Sub