Article ID: 182694
Article Last Modified on 6/17/2005
A1: 1996 B1: February C1: 23
A2: 1997 B2: March C2: 18
A3: 1998 B4: September C3: 7
A4: 1999 B4: November C4: 3
Property Value
----------------------
BoundColumn 1
ColumnCount 3
Private Sub UserForm_Initialize()
' Populate the ListBox.
ListBox1.List = Worksheets("Sheet1").Range("A1:C4")
End Sub
Private Sub ListBox1_Change()
Dim SourceData As Range
Dim Val1 As String, Val2 As String, Val3 As String
' Get Range that the ListBox is bound to.
Set SourceRange = Worksheets("Sheet1").Range("A1:C4")
Val1 = ListBox1.Value
' Get the value of the second column.
Val2 = SourceRange.Offset(ListBox1.ListIndex, 1).Resize(1, _
1).Value
' Get the value of the third column.
Val3 = SourceRange.Offset(ListBox1.ListIndex, 2).Resize(1, _
1).Value
' Concatenate the three values together and display them in
' Label1.
Label1.Caption = Val1 & " " & Val2 & " " & Val3
End Sub
listbox control
179216 OFF98: How to Use the Microsoft Office Installer Program
Additional query words: XL98
Keywords: kbhowto kbprogramming kbdtacode KB182694