Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Sort Combobox Items in Userform - shahzad


Hi, I have a prepared a Userform with many text boxes to retrive my
data in userform from worksheet by using a Combobox. my combobox is
linked to Column B, Range is B4:B100. and I have a List of Material
in B column, but when I Run userform I could not see all the list by
Alphabetically.

My combobox should show all records alphabetically. can anyone help me
in this regard.


COLUMN "B" Contains the following:
---------------------
Water Heaters 300 W
Heating Elements 250 W
Muslim Shower
Laundry Tumbler
Yellow Paint
Blue Paint
Squash Tape
AHU Filter
Fax Machine
Bearing
Brass Holder
ETC....


Private Sub Userform_activate()

ComboBox1.SetFocus
ComboBox1.RowSource = "B4:B100"

End Sub

Pls give me any Idea to sort my combobox A to Z.

Thanks in Advance.



Syed shahzad zafar
Madinah - KSA.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Sort Combobox Items in Userform - shahzad

Can't you just to a Data/Sort on B4:B100 from the worksheet? If the list is
in sorted order on the sheet, then the RowSource assignment will put them
into the ComboBox in that sorted order.

Rick


wrote in message
ups.com...

Hi, I have a prepared a Userform with many text boxes to retrive my
data in userform from worksheet by using a Combobox. my combobox is
linked to Column B, Range is B4:B100. and I have a List of Material
in B column, but when I Run userform I could not see all the list by
Alphabetically.

My combobox should show all records alphabetically. can anyone help me
in this regard.


COLUMN "B" Contains the following:
---------------------
Water Heaters 300 W
Heating Elements 250 W
Muslim Shower
Laundry Tumbler
Yellow Paint
Blue Paint
Squash Tape
AHU Filter
Fax Machine
Bearing
Brass Holder
ETC....


Private Sub Userform_activate()

ComboBox1.SetFocus
ComboBox1.RowSource = "B4:B100"

End Sub

Pls give me any Idea to sort my combobox A to Z.

Thanks in Advance.



Syed shahzad zafar
Madinah - KSA.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Sort Combobox Items in Userform - shahzad

Sort the source data if you want it sorted in the Combo.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
ups.com...

Hi, I have a prepared a Userform with many text boxes to retrive my
data in userform from worksheet by using a Combobox. my combobox is
linked to Column B, Range is B4:B100. and I have a List of Material
in B column, but when I Run userform I could not see all the list by
Alphabetically.

My combobox should show all records alphabetically. can anyone help me
in this regard.


COLUMN "B" Contains the following:
---------------------
Water Heaters 300 W
Heating Elements 250 W
Muslim Shower
Laundry Tumbler
Yellow Paint
Blue Paint
Squash Tape
AHU Filter
Fax Machine
Bearing
Brass Holder
ETC....


Private Sub Userform_activate()

ComboBox1.SetFocus
ComboBox1.RowSource = "B4:B100"

End Sub

Pls give me any Idea to sort my combobox A to Z.

Thanks in Advance.



Syed shahzad zafar
Madinah - KSA.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Sort Combobox Items in Userform - shahzad

If you have a reason not to sort the worksheets, you can use this method by
John Walkenbach. You wold remove the RowSource command you show:

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

Breaking the rowsource may require you to change the code you currently use
to populate your textboxes.
--
Regards,
Tom Ogilvy


" wrote:


Hi, I have a prepared a Userform with many text boxes to retrive my
data in userform from worksheet by using a Combobox. my combobox is
linked to Column B, Range is B4:B100. and I have a List of Material
in B column, but when I Run userform I could not see all the list by
Alphabetically.

My combobox should show all records alphabetically. can anyone help me
in this regard.


COLUMN "B" Contains the following:
---------------------
Water Heaters 300 W
Heating Elements 250 W
Muslim Shower
Laundry Tumbler
Yellow Paint
Blue Paint
Squash Tape
AHU Filter
Fax Machine
Bearing
Brass Holder
ETC....


Private Sub Userform_activate()

ComboBox1.SetFocus
ComboBox1.RowSource = "B4:B100"

End Sub

Pls give me any Idea to sort my combobox A to Z.

Thanks in Advance.



Syed shahzad zafar
Madinah - KSA.


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
Retrive Records in UserForm and Edit - from shahzad [email protected] Excel Programming 2 June 28th 07 09:13 PM
Retrive Data in Userform [from Shahzad] [email protected] Excel Programming 3 June 27th 07 06:40 PM
Combobox items determined by the selection in another combobox Alerion Excel Programming 2 September 13th 06 01:07 PM
how to add items to combobox Marek Excel Programming 3 August 30th 04 10:31 AM
ComboBox items Keith Willshaw Excel Programming 2 July 17th 03 11:22 AM


All times are GMT +1. The time now is 02:15 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"