Dummy Excel
Well-known Member
- Joined
- Sep 21, 2005
- Messages
- 1,004
- Office Version
-
- 2019
- 2010
- 2007
- Platform
-
- Windows
Hi All,
I have some data with a total at the bottom. I need to sort my data without including the totals row
my code is:
any ideas?
thanks
Sam
I have some data with a total at the bottom. I need to sort my data without including the totals row
my code is:
Code:
ActiveWorkbook.Worksheets("STORE SUMMARY").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("STORE SUMMARY").Sort.SortFields.Add Key:=Range("K:K") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("STORE SUMMARY").Sort
.SetRange Range("A1").CurrentRegion
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
any ideas?
thanks
Sam