ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,251
- Office Version
- 2007
- Platform
- Windows
Morning,
I have the sort code as supplied below.
Some info for you.
I have headers in cell range A6:H6
Row 7 has the first line of values then continue down the page.
The range of values are A7:H40
Example.
Cell H7 value CC
Cell H8 value AA
Cell H9 value BB
When i run the sort code it stays the same as opposed to sorting AA BB CC
I have the sort code as supplied below.
Some info for you.
I have headers in cell range A6:H6
Row 7 has the first line of values then continue down the page.
The range of values are A7:H40
Example.
Cell H7 value CC
Cell H8 value AA
Cell H9 value BB
When i run the sort code it stays the same as opposed to sorting AA BB CC
Code:
Private Sub SortYearButton_Click() Dim x As Long
Application.ScreenUpdating = False
With Sheets("MC LIST")
If .AutoFilterMode Then .AutoFilterMode = False
x = .Cells(.Rows.Count, 1).End(xlUp).Row
.Range("A7:H" & x).Sort key1:=Range("H7"), order1:=xlAscending, Header:=xlGuess
End With
ActiveWorkbook.Save
Application.ScreenUpdating = True
Sheets("MC LIST").Range("H7").Select
End Sub