Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Need to add mutliple columns to a List Box

Hello
I am working on an excel form that contains a multiselect listbox. This
listbox needs to be populated from two different tables (a join on access)
and needs to display multiple fields. Apart from using tabs, is there a
better way to use the column(s) to display these fields individually
(programmatically)
The restriction is that i cannot use a temporary worksheet and load
them up from that worksheet (ie dataacess is a range on that sheet).


Thanks
Martin


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Need to add mutliple columns to a List Box

I don't know anything about access or joins, but maybe you can pick something
out of this:

Option Explicit
Private Sub CommandButton1_Click()
Dim iCtr As Long

With Me.ListBox1
For iCtr = 0 To .ListCount - 1
If .Selected(iCtr) Then
MsgBox .List(iCtr, 0) & vbLf & _
.List(iCtr, 1) & vbLf & _
.List(iCtr, 2)
End If
Next iCtr
End With

End Sub

Private Sub UserForm_Initialize()

Dim iCtr As Long
With Me.ListBox1
.MultiSelect = fmMultiSelectMulti
.ColumnCount = 3
.ColumnWidths = "25;25;25"
For iCtr = 1 To 10
.AddItem CStr(iCtr)
.List(.ListCount - 1, 1) = iCtr * 2
.List(.ListCount - 1, 2) = iCtr * 3
Next iCtr
End With
End Sub




Martin SChukrazy wrote:

Hello
I am working on an excel form that contains a multiselect listbox. This
listbox needs to be populated from two different tables (a join on access)
and needs to display multiple fields. Apart from using tabs, is there a
better way to use the column(s) to display these fields individually
(programmatically)
The restriction is that i cannot use a temporary worksheet and load
them up from that worksheet (ie dataacess is a range on that sheet).

Thanks
Martin


--

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
mutliple matches for v lookup Tacklemom Excel Discussion (Misc queries) 2 February 1st 10 07:04 PM
Sumproduct across mutliple columns JANA Excel Worksheet Functions 3 January 25th 10 04:39 AM
Mutliple Sumproduct criteria PJFry Excel Worksheet Functions 1 July 24th 09 01:08 AM
mutliple conditions Sue Excel Discussion (Misc queries) 1 May 2nd 08 10:13 PM
how to merge mutliple columns vertically techteacher Excel Worksheet Functions 0 March 10th 05 02:37 AM


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