Im using this code:
Sub SortTable()
Dim Filter As Variant
Dim ColHead As String
Dim rColumn As Range
Dim loITEM As ListObject
ActiveSheet.AutoFilterMode = False
ColHead = ActiveSheet.Range("B3").Value
If ColHead = "" Then
MsgBox ("please select a column header")
Exit Sub
End If
Set loITEM = ThisWorkbook.Worksheets("Items").ListObjects("Items")
Filter = ActiveSheet.Range("B1")
If Not IsNumeric(Filter) Then
Filter = "*" & Filter & "*"
End If
'Get the column reference
Set rColumn = loITEM.ListColumns(ColHead).DataBodyRange
loITEM.Range.AutoFilter Field:=rColumn.column - 1, Criteria1:=Filter, Operator:=xlFilterValues
End Sub
the seach criteria is either a string or a number. i want to beable to search for the criteria any where within the cells. The string works fine, but when i use a number it wont work???
Ive tried so many variations and even set it as just a straight number and it still wont work!!!!
help appreciated!
Bookmarks