PDA

View Full Version : mutliselect listbox via looping a range



eDIN
07-22-2011, 09:09 AM
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!

Kenneth Hobs
07-22-2011, 08:47 PM
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

eDIN
07-24-2011, 01:57 PM
ThankYou Keneth
That's it.