Hi,
I'm quite new to VB. Anyway, i have a worksheet macro created from officeXP, but doesnt run on 2003. I suspect it is this subroutine, as my macro shows this "Object doesnt support this property or method" when it run this subroutine. Can anyone help? thanks.
Sub CreateSubtotal()
'
' subtotal Macro
'
'
Cells.Select
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("J2:J1096" _
), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A1:J1096")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Selection.subtotal GroupBy:=10, Function:=xlSum, TotalList:=Array(7), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
End Sub
Bookmarks