Sorting a single column

  • Thread starter Thread starter Ken Loomis
  • Start date Start date
K

Ken Loomis

In some VBA code, I need to sort column A on a hidden sheet called
"OldFiles". Column A is the only column containing data, so that is all that
needs to be sorted.

Can I do that without selecting that column.

and, either way, what VBA would I use?

It needs to be sorted alphabetically in ascending order.

TIA,
Ken
 
Try something like this...

Sub SortColumn()
Dim rngToSort As Range

Set rngToSort = ActiveSheet.Range("A:A")

rngToSort.Sort Key1:=Range("A:A")

End Sub
 
Back
Top