Search for what? in what row? Sort what (If you are sorting just the heading it just stays there)?
Basically supply the relevant details.
I want to search for "Start Time" column, then want to sort the rows of table, based on values in column heading "Start Time". Since the actual code is to big I am providing part of it only.
Dim rangecount As Integer
Dim colcount As Integer
Dim ra As Range
Sheets("After Removing Duplicates").Select
rangecount = ActiveSheet.UsedRange.Rows.Count
colcount = ActiveSheet.UsedRange.Columns.Count
Set ra = Worksheets("After Removing Duplicates").Cells.Find("Start time", LookAt:=xlWhole)
If ra Is Nothing Then
MsgBox "Name was not found."
Else
MsgBox "Name found at :" & ra.Address
MsgBox ("value of ra variable is " & ra.Value)
End If
ActiveWorkbook.Worksheets("After Removing Duplicates").Sort.SortFields.Add2 Key _
:=Range(ra.Column & "2:" & ra.Column & rangecount), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal