Controls on the toolbox

lookingforhelp

New Member
Joined
Mar 21, 2004
Messages
31
Hey
Just wanted to find out how do you insert VB code for controls on the toolbox such as list box, combo box, scroll bar etc etc
Anyone know the basic code and then i can fill in the rest for example if i add a list box to a form how do i enter the text which should appear on that aboject?
thanks
:biggrin:
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
A Right Mouse click on any object will allow you to get into the properties of that object. Right Mouse click and select Properties
 
Upvote 0
Hello
Yeah but if you have a list box where in the properties do you fill in what text you want to be listed? And where do you fill in text for the other control objects in the toolbox?
thanks :confused:
 
Upvote 0
Double click on an object and the VB editor will open and it will show the default event procedure for that control.

e.g. if you double click on a combobox you will get this

Code:
Private Sub ComboBox1_Change()

End Sub
 
Upvote 0
hello
yeah that appears but then what do you type inbetween
so that the text you want listed appears?

Eg:
Private Sub ListBox1_Click()
blue,yellow,green,red (text i want in list) (is this how you type it)
End Sub


:rolleyes:
 
Upvote 0
The RowSource property of a listbox will set what is listed.

It will accept an Excel range.

Or use the AddItem method

E.G. Listbox1.AddItem "Blue" etc
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,317
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top