• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

how to make combobox on form?

mahaveer

Member
i want to add a combobox on userform and i want to add the list for combobox on userform too..

i know it how to add a combobox on userform with the help of excel data but now i want to add combobox on userform without the help of excel data...is it possible that we can add our list on userform and that list can be use for the combobox?


Thanks


CA Mahaveer Somani
 
Private Sub UserForm_Initialize()

ComboBox1.AddItem ("Jan")

ComboBox1.AddItem ("Feb")

ComboBox1.AddItem ("March")

ComboBox1.AddItem ("April")

ComboBox1.AddItem ("May")

ComboBox1.AddItem ("June")

ComboBox1.AddItem ("July")

ComboBox1.AddItem ("August")

ComboBox1.AddItem ("September")

ComboBox1.AddItem ("October")

ComboBox1.AddItem ("November")

ComboBox1.AddItem ("December")

End Sub


this is the right code i made it my self.....

thanks to all

i dont know how to remove my query from this post...therefore sorry to all....
 
Hi Mahaveer ,


You can also have the following code :


Mnths = Array("Jan","Feb","Mar","Apr","May","June","July","Aug","Sep","Oct","Nov","Dec")

ComboBox1.List = Mnths


Narayan
 
Thanks narayank

this is really nice one as compare to me......

but if i want to create a dependent combobox2 list then how can i do this?
 
Hi Mahaveer ,


First you will have to let us know how the dependency happens ; let us assume you have two lists ; List1 has 100 unique items , and List2 has 70 unique items ; however , the choice of items available once a particular choice has been made from List1 , may be less than 70 , because the second list is dependent on the choice made from the first list.


A similar question has been posted earlier in this forum here :


http://chandoo.org/forums/topic/dependable-lists-with-large-data-array-required-keeps-crashing


If you can give the details of the individual lists , or better still , upload your sample workbook , it will make it easier to write the code.


Narayan
 
Back
Top