Sorting a single column

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
 
G

Guest

Try something like this...

Sub SortColumn()
Dim rngToSort As Range

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

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

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top