ListBox MultiSelectMulti mode

C

CG Rosén

Good Evening Group,

Below code works fine when my ListBox is in normal mode. But how to rewrite
the
code to work in MultiSelectMulti mode?
Hope for your skilled assistance.

Brgds

CG Rosén

Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

With Blad1.Range("A1:A100")

Set k = .Find(UserForm1.ListBox1.Text, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByColumns)

If Not k Is Nothing Then

r = k.Row

Sheet1.Cells(r, 1).ClearContents

End If

End With
 
T

Tom Ogilvy

Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

With Blad1.Range("A1:A100")
for i = 0 to Listbox1.ListCount -1
if Listbox1.Selected(i) then
Set k = .Find(UserForm1.ListBox1.List(i,0), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByColumns)

If Not k Is Nothing Then
r = k.Row
Sheet1.Cells(r, 1).ClearContents
end if
End If
Next
End With
 

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

Similar Threads


Top