Consulting

Results 1 to 2 of 2

Thread: listbox usage in vba

  1. #1
    VBAX Newbie
    Joined
    Oct 2010
    Posts
    4
    Location

    listbox usage in vba

    Hi,
    I have a sample VBA application, where in a dropdown gets populated dynamically.
    hence I am not able to view the items in the dropdown completely.
    Can you suggest & clarify a few doubts of mine regarding the same.
    Q1. Usage of which component is better in the above scenario.i.e a listbox or a dropdown(ActiveX-control).
    Q2. Assuming that usage of listbox is a good design option, How can i name a listbox?
    Q3. What are the events that can be associated with the value change of the listbox.

    Anticipating the favorable reply at the earliest.
    Regards,
    Anu

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,911
    Location
    A1. By dropdown, I think that you mean ComboBox. If you have that many items then a listbox might not show all either.

    A2. You can name it in 4 ways at least. (1) Use the name box just as you would for any range name when it is selected in Design Mode. (2) Right click in Design Mode and select Properties and change the name there. (3) Right click the sheet's tab with the code and View Code or open the VBE and select that sheet object in the Project Explorer. Press F4 to view the properties or by menus View > Properties Window and set the name as in step (2). (4) Use a macro method.

    A3. Right click the sheet's tab with the code and View Code. Select the control from the dropdown list. Select events from the other dropdown list.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •