excel - Application or object defined error. Run time error 1004 -


cells.sort key1:=range(rng1), order1:=xlascending, key2:=range(rng2) _   , order2:=xlascending, header:=xlyes, ordercustom:=1, matchcase:= _   false, orientation:=xltoptobottom, dataoption1:=xlsorttextasnumbers, dataoption2 _   :=xlsortnormal 

it's throwing error called application error or object defined error.

try sort operation coding alternative. pared down absolutely need.

dim rng1 range, rng2 range  activesheet   '<-set sheets("sheet1")     set rng1 = .range("a1")   'top cell of primary sort key     set rng2 = .range("b1")   'top cell of secondary sort key     .range("a1").currentregion        '<-sort 'island' of data surrounds a1 (with header)         .cells.sort key1:=rng1, order1:=xlascending, _                     key2:=rng2, order2:=xlascending, _                     orientation:=xltoptobottom, header:=xlyes     end end 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -