Skip to main content

Sort Range

Excel·v1.11.1
ExcelEditingWrites files

Sort rows by one column, then optionally a second. Whole rows move and carry their formatting, and blanks sink

Inputs

NameTypeRequiredDefaultDescription
Excel Instance
excelInstance
variableRequired
Sheet Name
sheetName
stringOptionalLeave empty for the first sheet
Range
range
stringOptionalLeave empty for everything on the sheet
First Row Is Headings
hasHeaders
booleanOptionaltrue
Sort By
sortBy
stringRequiredA column heading, or its letter
Order
direction
enumOptionalascending
ascendingdescending
Then By
thenBy
stringOptionalOptional second column, used to break ties
Then Order
thenDirection
enumOptionalascendingOnly used when a second column is given
ascendingdescending

Compatibility

WindowsLinuxAttendedUnattended

Related activities