Autofilter error

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,132
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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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