Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Cannot dropitem from multiselect listbox

I pasted the wrong code (sigh).

I meant this:

Private Sub UserForm_Initialize()

Dim iCtr As Long

With Me.ListBox1
.List = Worksheets("sheet1").Range("a1:a10").Value
End With

With Me.ListBox2
.List = Worksheets("sheet1").Range("b1:b10").Value
End With

Me.ListBox1.MultiSelect = fmMultiSelectMulti
Me.ListBox2.MultiSelect = fmMultiSelectMulti

End Sub

You don't need to go cell by cell.

(sorry.)

I think I had the worksheet version in another module and screwed up by copying
from there.


Edward Glover wrote:

You've solved my problem. I had the range set in the listbox rowsource
properties window (Sheet1! A3:A25), however your last response led me to
populating the listbox through the userfrm_initialize procedure. This
resulted in the code executing the removeitem and clear listbox methods.

I wasn't able to take advantage of the sample code you provided because
the listfillrange listbox method was not recognized. Instead I used the
following:

Private Sub UserForm_Initialize()

Dim cell As Range
Dim Rng As Range

With ThisWorkbook.Sheets("Sheet1")
Set Rng = .Range("a3", "a25")
End With

For Each cell In Rng.Cells
Me.ListBox1.AddItem cell.Value
Next cell

Me.ListBox1.MultiSelect = fmMultiSelectMulti
Me.ListBox2.MultiSelect = fmMultiSelectMulti

End Sub

thx. for all your responses. I really appreciate your assistance.

Edward

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiselect Listbox use RKS Excel Discussion (Misc queries) 1 May 12th 06 03:04 PM
multiselect on a listbox from Control toolbox Kanan Excel Programming 5 July 31st 04 12:01 AM
MultiSelect ListBox in Excel PeteSmith Excel Programming 1 April 20th 04 11:14 AM
Excel VBA-Looping though MultiSelect on ListBox jpendegraft[_3_] Excel Programming 2 February 3rd 04 04:38 PM
multiselect listbox CG Rosén Excel Programming 2 December 28th 03 05:17 PM


All times are GMT +1. The time now is 02:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"