+ Reply to Thread
Results 1 to 2 of 2

Listbox- 1st item is not getting highlighted

Hybrid View

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Listbox- 1st item is not getting highlighted

    Hi All,
    i have following code. When user form is shown list box has focus on "item1" and not on "Select All"

    Private Sub UserForm_Initialize()
       Dim vList
       vList = Array("item1", "item2", "item3")
       With Me.ListBox1
          .List = vList
         ' add "Select all" as first item
          .AddItem "Select All", 0
       End With
       ListBox1.Selected(0) = True
       
    End Sub
    anybody any idea on this

    thanks
    megha

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Listbox- 1st item is not getting highlighted

    Pasted your code into a userform with a listbox - works fine in isolation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1