Autofilter error

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,059
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
I have this code and if run the same on 2016 then its gives error as Run-time error 438 object don't support this property, if the same is running in office 365, any way to fix it

I am trying it for more than 2 hrs but no luck.

VBA Code:
            ActiveSheet.AutoFilterMode = False
                Range("CP1").Select
                n = Worksheets("WFMS-Dump").Cells(Rows.Count, 2).End(xlUp).Row
            
            Selection.AutoFilter
            [B]ActiveWorkbook.Worksheets("WFMS-Dump").Sort.SortFields.Add2 Key:=Range(Cells(2, 94), Cells(n, 94)), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal[/B]  'Run-time error 438 object don't support this property
            With ActiveWorkbook.Worksheets("WFMS-Dump").Sort
                .SetRange Range(Cells(1, 1), Cells(n, 94))
                .Header = xlYes
                .MatchCase = False
                .Orientation = xlTopToBottom
                .SortMethod = xlPinYin
                .Apply
            End With
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try changing Add2 to just Add.

 
Upvote 0
Solution
thanks man, such a small think i missed it. thanks ,man.
 
Upvote 0

Forum statistics

Threads
1,215,077
Messages
6,122,991
Members
449,094
Latest member
masterms

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top