multiselect listbox

C

CG Rosén

Good Day Group,

What syntax to use to state that a MultiSelect
Listbox has no selection? To be used in the context:
If ListBox1 .....no selection.... Then etc...

Brgds

CG Rosén
 
R

Ron de Bruin

Try this

N = 0
For i = 0 To Userform1.ListBox1.ListCount - 1
If Userform1.ListBox1.Selected(i) = True Then
N = N + 1
End If
Next i
If N = 0 Then MsgBox "no selection"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top