Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Runtime Error on Simple Sort
I have the following Code:
Sub CmdSortMe_Click() UnprotectAll 'above routine unprotects current workbook and worksheet CreateAllStyleList 'above routine gathers data from 3 worksheets into and array and writes array to Worksheet("Cost&Margin") With Worksheets("Cost&Margin") Dim rg As Range Set rg = Range("StyleRange") rg.Sort key1:=rg, order1:=xlAscending ProtectAll 'routine protects current worksheet and workbook End With End Sub I get the "Run-time error '1004': Application-defined or object-defined error on the code that sorts. If I omit calling subroutine CreatAllStyleList the sort code executes without error. What am I doing wrong? Thanks, Brent |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
xpath error? Runtime Error 13 type mismatch | Excel Discussion (Misc queries) | |||
Runtime error '1004' General ODBC error | New Users to Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming | |||
Unknown where is the problem on the Runtime error - Automation error | Excel Programming |