LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Extract values from a multi-select multi-column list-box

I have a multi-select list box with the column count property set to 2
The program (before loading the form) sets the range name 'Contractors' to
cover two columns: The contractors' names and their respective VAT
registration numbers.

The form loads Rowsource with Factors!Contractors and shows the names of the
contractors and their VAT registration numbers. So far so good.
The user is asked to select one (or more) contractors.

I am trying to get the routine below to load the two (Public) string arrays:
Contractor(xx) and VatRegistration(xx) with the values wherever a
selection(s) is made:

Extract from the 'Run' button code:

Private Sub cmdRun_Click()
Dim i As Integer
LBoxContractors.BoundColumn = 1
LBoxContractors.TextColumn = 2
If LBoxContractors.ListIndex < -1 Then
For i = 0 To LBoxContractors.ListCount - 1
If LBoxContractors.Selected(i) Then
Contractor(i) = LBoxContractors.List(i)
VatRegistration(i) = LBoxContractors.Text
End If
Next i
End If
End sub

The Contractor(i) loads up fine but the VatRegistration(i) has just a NUL
string (""). Can't seem to be able to assign the value in the 2nd column.

Any help or suggestions or ideas or better ways of doing this would be most
welcolm.

Thanks in advance,
Peter Bircher




 
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
How to find a value with multi-column, multi-record list Dallasm Excel Worksheet Functions 1 May 30th 10 05:40 PM
Multi Select from Drop List PatriciaT Excel Discussion (Misc queries) 2 September 8th 09 06:33 PM
how do I select multi values from a list Tommy Excel Discussion (Misc queries) 1 July 12th 06 09:38 AM
List Box Multi Select Option ann_nyc Excel Worksheet Functions 0 October 11th 05 05:56 PM
Multi Select List Box jacqui Excel Programming 0 July 22nd 03 12:12 PM


All times are GMT +1. The time now is 08:20 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"