您好我试图在我已经制作的表格中对数据进行排序。这是我的代码:
Dim tbl As ListObject
Set tbl = ws1.ListObjects("PlanDataTable")
Dim so As Sort
With tbl.Sort
With .SortFields
.Clear
.Add Range("tbl[[#All],[PlanType]]"), SortOn:=xlSortOnValues, Order:=xlAscending
End With
.Header = xlYes
.Orientation = xlTopToBottom
.Apply
End With
当我到达.Add Range("tbl[[#All],[PlanType]]"), SortOn:=xlSortOnValues, Order:=xlAscending
时,我得到应用程序定义的错误并且不知道为什么。不要以为有人知道为什么