Thread: [Solved] runtime error 1004
View Single Post
 
Old 06-01-2012, 01:28 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

That's an odd one. I used google and I found this thread. So, using the suggestion there:
Code:
            With .Sort
                .SortFields.Add _
                     Key:=fRange, _
                     SortOn:=xlSortOnValues, _
                     Order:=xlAscending, _
                     DataOption:=xlSortNormal
                 .SetRange sRange
                 .Header = xlGuess
                 .MatchCase = False
                 .Orientation = xlTopToBottom
                 .SortMethod = xlPinYin
                 Application.Calculate
                 .Apply
                 .SortFields.Clear
            End With
The person that had the problem on the other thread said this version failed on the first run, but after that it worked fine.
Reply With Quote