Thread: Macro sorts
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Macro sorts

Which line does it fail on. I can't make it fail on my computer. (2003)

"C Brandt" wrote:

I have been having problems with macros seeming to work, then at a later
date, failing and coming up with an error.

The latest instance is where I develop the macro using the record feature. I
select a single column of a spread sheet, then sort it. When I run the
macro it errors out on the sort. If I then manually do the sort, it asks me
if I want to expand the columns. I answer NO then it proceeds as expected.
I'M guessing that this intermediate question is the problem. How do I get
around it.

I have included the code that's failing.

Columns("C:C").Select
Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Thanks for any assistance,

Craig