Run time error '1004'

A

aeddave

I assigned a recorded macro to an object. When clicked it sorts range
A12:A2500. It works fine until I turn on sheet protection. The range is not
protected, nor is the object.

I receive the error above with "Sort method of range class failed".
Debugging shows below with "Selection....normal" highlighted.

Any help is appreciated

Sub SortByType()
'
' SortByType Macro
' Macro recorded 1/29/2008 by mcgind1
'

'
Range("A12").Select
Application.Goto Reference:="R12C1:R5000C7"
Selection.Sort Key1:=Range("B12"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A12").Select
End Sub
 
D

Dave Peterson

If you know the password, just have your sort routine unprotect the worksheet,
sort the data and reprotect the sheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top