Sorting a listbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm have a worksheet with lots of tabs in it. I'm using the code below to
populate a listbox with all the sheetnames, however I would like the results
sorted in alphabetal order. Any ideas would be much appreciated. Thanks!

Sub PopulateListbox()

ListBox1.Clear

For i = 1 To Sheets.Count

ListBox1.AddItem Sheets(i).Name

Next

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

Back
Top