Number Ascending

Eric Penfold

Active Member
Joined
Nov 19, 2021
Messages
424
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Try to make number ascending in a column gets to

VBA Code:
        .AutoFilter Field:=iCol, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
      :=xlSortNormal

The Error says "Object dosen`t support this property or method" ??

VBA Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

    With Target.Font
        .Name = "Calibri"
        .Size = 11
        Selection.RowHeight = 15
        Selection.EntireColumn.AutoFit
        
Dim lo As ListObject
Dim iCol As Long

Set lo = Sheet2.ListObjects("Frost_Table")
 
 iCol = lo.ListColumns("Part No").Index
        
        .AutoFilter Field:=iCol, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
      :=xlSortNormal
        
End With
    


End Sub
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Sorting is not an option under "Target.Font"
VBA Code:
    With Target.Font
It cannot be contained with the that "With ... End With" block.
 
Upvote 0
Ok I`ve altered it but now it`s saying Error 448 "Named argument not found" in the same part of the code.
 
Upvote 0
Ok I`ve altered it but now it`s saying Error 448 "Named argument not found" in the same part of the code.
Sorry, I have been out of town for a few days.

Do you have a good understanding on how to use WITH clauses?
If you turn on your Macro Recorder and record yourself performing the steps you want manually, you will be able to get most of the VBA code that you need to plug into your current procedure.

If you are still having issues, please post your altered code.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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