我有以下代码,我得到了运行时错误' 91'问题。我是VBA脚本新手并使用excel制作宏。提前致谢。
Sub ProjectType_Sort()
'
' ProjectType_Sort Macro
'
'
ActiveWorkbook.Worksheets("P09").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("P09").AutoFilter.Sort.SortFields.Add
Key:=Range(_"G4"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:= _xlSortNormal
With ActiveWorkbook.Worksheets("P09").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Selection.AutoFilter
Range("G12").Select
End Sub