Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort data from smallest to largest
I need to sort data in Column A in numerical order from smallest to
largest, and that is correct for any number of rows. So this macro could be run on a column that has data on rows 3-200, or on rows 3-500. Does anyone know how to write code in VBA for this in excel 2007? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort data from smallest to largest
Mary
This little macro will sort column A from A2 down to the last entry in that column. I assumed you have headers in row 1. HTH Otto Sub SortColA() Dim rColA As Range Set rColA = Range("A2", Range("A" & Rows.Count).End(xlUp)) rColA.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End Sub "Mary Pencey" wrote in message ... I need to sort data in Column A in numerical order from smallest to largest, and that is correct for any number of rows. So this macro could be run on a column that has data on rows 3-200, or on rows 3-500. Does anyone know how to write code in VBA for this in excel 2007? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
smallest to largest | Excel Discussion (Misc queries) | |||
Smallest to Largest | Excel Worksheet Functions | |||
Find Smallest and Largest. | Excel Worksheet Functions | |||
functions largest to smallest | Excel Worksheet Functions | |||
COMPARE DATA AND LIST SMALLEST AND LARGEST ENTRY BY UNIT | Excel Discussion (Misc queries) |