Consulting

Results 1 to 3 of 3

Thread: mutliselect listbox via looping a range

  1. #1
    VBAX Newbie
    Joined
    Jul 2011
    Posts
    3
    Location

    mutliselect listbox via looping a range

    I fill a userform mutliselect listbox via looping a range.
    What i want is: if a font in paritcular cell (within the range) is bold Then
    that items in listbox automatically becomes selected

    Thanks!

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    [VBA]Private Sub UserForm_Initialize()
    Dim cell As Range, count As Long
    count = -1
    For Each cell In Range("A1:A10")
    ListBox1.AddItem cell.Value2
    count = count + 1
    If cell.Font.Bold = True Then ListBox1.Selected(count) = True
    Next cell
    End Sub[/VBA]

  3. #3
    VBAX Newbie
    Joined
    Jul 2011
    Posts
    3
    Location
    ThankYou Keneth
    That's it.

Posting Permissions

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