Hi,
I have the following macro with me which is giving me an error message type mismatch with run time error 13 when i run it. Pleaes help me in fixing it..
Sub sort()
    Dim lngLastRow As Long
    Dim rngAddress
    lngLastRow = Cells(Rows.Count, "A").End(xlUp).Row
rngAddress = Range("A1:AZ1").Find("Document Date").Address
  rngAddress = Mid(rngAddress, 2, 1)
  
'Sorting based on document date
    ActiveWorkbook.Worksheets("HC6B").sort.SortFields.Clear
    ActiveWorkbook.Worksheets("HC6B").sort.SortFields.Add Key:=(rngAddress & "2:" & rngAddress & lngLastRow), _
        SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("HC6B").sort
        .SetRange Range("A1:AC12")
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
      
End Sub