dariuzthepole
Board Regular
- Joined
- Jul 23, 2008
- Messages
- 111
Hi Folks,
I've seen a lot of posts similar to this problem and while I have tried to follow the suggested steps, none seem to be working for me.
I'm attempting to copy a small range of formulas, pasting these in the adjacent column as values, then sorting these values alphabetically top down. It is the sorting part that seems to be causing the error (see code below).
I'm using 2010 and this sheet is hidden and protected. Any help would be greatly appreciated!
I've seen a lot of posts similar to this problem and while I have tried to follow the suggested steps, none seem to be working for me.
I'm attempting to copy a small range of formulas, pasting these in the adjacent column as values, then sorting these values alphabetically top down. It is the sorting part that seems to be causing the error (see code below).
Code:
Dim groups As Range
Dim target As Range
Set groups = Worksheets("3rdPlace").Range("L2:L5")
Set target = Worksheets("3rdPlace").Range("M2:M5")
Application.ScreenUpdating = False
groups.Copy
target.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
target.Sort
ActiveWorkbook.Worksheets("3rdPlace").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("3rdPlace").Sort.SortFields.Add Key:=Range("M2"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("3rdPlace").Sort
.SetRange Range("M2:M5")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
I'm using 2010 and this sheet is hidden and protected. Any help would be greatly appreciated!