Excel...PLEASE HELP!!!

jonworth

Baseband Member
Messages
26
I am trying to put a combo box in a userform on VB in Microsoft Excel. I have the data i want in the combo box on a spreadsheet, however i cannot use ControlSource to have more than one. For example i can use Customers!A15 to get data from that cell, however i cannot use Customers!A15:A40 to get data from all required cells. Anyone know how?? Any help will be very much appreciated.
 
have also tried the following in modules and combobox commands as suggested by a teacher at col. Why does it tell me that he had no idea what he was on about???

Private Sub UserForm2_Initalize()
' adds data to the spreadsheet

If init% = False Then
ComboBox1.AddItem ("Paris")
ComboBox1.AddItem ("Malaga")
ComboBox1.AddItem ("Alicante")
ComboBox1.AddItem ("Munich")
ComboBox1.AddItem ("Amsterdam")
ComboBox1.AddItem ("Barcalona")
ComboBox1.AddItem ("Prague")
ComboBox1.AddItem ("Dublin")
ComboBox1.AddItem ("Edinburgh")
ComboBox1.AddItem ("Belfast")
ComboBox1.AddItem ("Manchester")
ComboBox1.AddItem ("Birmingham")
ComboBox1.AddItem ("Heathrow")
ComboBox1.AddItem ("Vienna")
ComboBox1.AddItem ("Lisbon")
ComboBox1.AddItem ("Milan")
ComboBox1.AddItem ("Copenhagen")
ComboBox1.AddItem ("Moscow")
ComboBox1.AddItem ("Glasgow")
ComboBox1.AddItem ("Cardiff")
ComboBox1.AddItem ("Lyon")
ComboBox1.AddItem ("Ibiza")
ComboBox1.AddItem ("Rome")
ComboBox1.AddItem ("Mahon")
ComboBox1.AddItem ("Lanzarote")
ComboBox1.AddItem ("Tenerife")

If init% = True Then
End If
End Sub
Please help this is for coursework and cant find any help anywhere else. i need those countries on a combo box in vb userform
 
ok sorry bout that mate just gotta say i found out a way now anyway. Was using ControlSource instead of RowSource Doh!!!
 
Back
Top Bottom