Notice: WC_Cart::get_cart_url is deprecated since version 2.5! Use wc_get_cart_url instead. in /home/swatipaliwal/public_html/excelcrazy.com/wp-includes/functions.php on line 3839
Excel Crazy

Listbox in Excel VBA

An Excel VBA listbox, is a drop down list from where the user can make a choice. Learn how to draw a listbox on your worksheet, how to add items and how to execute result with help of VBA code.

Draw a Listbox

Click on the Insert from the Developer tab and then click on List Box in the Active X controls section.

 

 

 

 

 

 

Draw Listbox in your worksheet and enter some values in column A.

 

 

 

 

 

 

 

 

 

Add Items in Listbox:

Select Design mode from the Developer Tab, then right click on List box and select Properties. Fill A1:A12 for ListFillRange.

 

 

 

 

 

 

 

 

 

 

Now double click on the Listbox (make sure design mode is selected). Write the below mention code on Listbox Click Event.

Private sub Listbox1_Click()

MsgBox “List box has been clicked, selection is “ & Listbox1

End Sub

Click Here to Download the file

March 15, 2012

0 responses on "Listbox in Excel VBA"

Leave a Message

Your email address will not be published. Required fields are marked *

top
 

© LOKESH PALIWAL 1987 - 2017

Reporting Solutions | Data Consulting | Analytics Training