Help with syntax

  • Thread starter Thread starter kirkm
  • Start date Start date
K

kirkm

I'd like to add sortorder=descending to this line

Worksheets(strSheetName).Range(strColumnRange).Sort _
Key1:=Worksheets(strSheetName).Range(strColumnRange)

but can't figure out how to.

Anyone know?

Thanks - Kirk
 
xlAscending or xlDescending

If you go to VBA window and right click. You can choose object browswer. I
went to the VBA help and found the parameter name XlSortOrder, but didn't
know what the values where. So I went to the object browser and did a search
for XlSortOrder and found the parameters to be xlAscending or xlDescending

Microsoft make thing very difficult to find.
 
Recording an operation in a macro often helps! E.g. this statement was
produced in this way:

Range("A1:Q22").Sort Key1:=Range("A2"), Order1:=xlDescending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Regards,
Stefi


„Joel†ezt írta:
 
Back
Top