Matt Ridge
Matt Ridge

Reputation: 3651

Organizing range of cells using Excel VBA

I have data about 400 rows in columns B through U. Column F is the one in where dates are posted. I need to have it where all the data is organized by column F, without messing up the rest of the cells adjoining it.

Is this possible? If so how?

Upvotes: 0

Views: 635

Answers (1)

mattboy
mattboy

Reputation: 2910

Range("F1").Sort key1:=Range("F1"), order1:=xlAscending

If you have some header rows that shouldn't sorted you'll need specify the complete Range to be sorted (e.g. Range("B2:U10").Sort...) instead. Replace order1 with xlDescending if you want it descending instead.

Upvotes: 1

Related Questions