joshuafournier
Board Regular
- Joined
- Mar 3, 2012
- Messages
- 91
good morning,
I am trying to sort in a macro. my formula is below. I'm sure I'm running into errors based on the protected hidden sheet. i have allowed 'sort' in the protection. ideally I am trying to sort by date which is in the 'A' column starting at "A3"
'sort internal
Sheets("IQuality Archive").Range("A3:G100").Select
ActiveWorkbook.Worksheets("IQuality Archive").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("IQuality Archive").Sort.SortFields.Add Key:=Range( _
"A3"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("IQuality Archive").Sort
.SetRange Range("A3:G15")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A2").Select
I am trying to sort in a macro. my formula is below. I'm sure I'm running into errors based on the protected hidden sheet. i have allowed 'sort' in the protection. ideally I am trying to sort by date which is in the 'A' column starting at "A3"
'sort internal
Sheets("IQuality Archive").Range("A3:G100").Select
ActiveWorkbook.Worksheets("IQuality Archive").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("IQuality Archive").Sort.SortFields.Add Key:=Range( _
"A3"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("IQuality Archive").Sort
.SetRange Range("A3:G15")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A2").Select