in Me.lbx.MultiSelect = fmMultiSelectMulti

  • Thread starter Thread starter x taol
  • Start date Start date
X

x taol

that case,,, the line have 50,000 data..
i want to select the all data...
but, lbx.selected(i)=true....... is no good... this is slow... for
loop..
at once,one stop,,,, setting
 
You don't say a lot about what you are doing, but this might be a way to do it

Dim lRow as long
dim myRange as range

Set myRange = activesheet.cells(1,1) 'First cell of range to select
lRow = activesheet.cells(activesheet.rows.count,myrange.column).end(xlup).row

if lRow > myRange.row then
Set myRange = myRange.resize(lrow-myrange.row + 1,1)
end if

myRange.select
 
yes, I explain....
I have a userform.
the userform has a listbox.
a property the listbox is set following below.
lbx.MultiSelect = fmMultiSelectMulti
when the listbox have 10000 data, the problem has.
when the 10000 data is selected... the slow...
and then press a commandbutton on the form, the event occur.
I want to select all data of listbox, fastly.
 
Try this worked very quickly @ 6000 + rows

Option Explicit

Private Sub CommandButton1_Click()
With Me.ListBox1
.RowSource = "A1:F65536" <--- change for your needs
End With
End Sub


Private Sub UserForm_Initialize()
With Me.ListBox1
.ColumnCount = 6< --- change for your needs
End With
End Sub
 

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

Back
Top