Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DN DN is offline
external usenet poster
 
Posts: 12
Default Sorting a listbox

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Sorting a listbox

Hi D,

See Jojn Walkenbach at:

http://j-walk.com:80/ss/excel/tips/tip47.htm


---
Regards,
Norman



"DN" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
userform listbox cannot get listbox.value to transfer back to main sub [email protected] Excel Programming 1 May 17th 06 09:44 PM
sorting a listbox in a user form [email protected] Excel Programming 4 March 6th 06 01:49 AM
VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox) modjoe23 Excel Programming 3 August 18th 05 02:35 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


All times are GMT +1. The time now is 06:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"