Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
View Listrow contents in Labels
Hi,
I found the below procedure in a userform, its showing the Listrow1 contents in the lable on the Userform. Private Sub ListBox1_Change() Dim SourceData As Range Dim Val1 As String, Val2 As String, Val3 As String Set SourceRange = Range(ListBox1.RowSource) Val1 = ListBox1.Value Val2 = SourceRange.Offset(ListBox1.ListIndex, 1).Resize(1, 1).Value Val3 = SourceRange.Offset(ListBox1.ListIndex, 2).Resize(1, 1).Value Label1.Caption = Val1 & " " & Val2 & " " & Val3 End Sub But I want to make some thing like this: Listbox1 = RowSource PROPERTY (B5:H500) my colums names are B: Name C: Company D: MobileNo. E: Phone 1 F: Phone 2 G: Fax H: E-Mail I put 6 labels in the userform to get the related data in Label from the Listbox, when I scroll the listbox items. I mean when I scroll the listbox by using up and down key Name should appear in the Label, and Company name should appear in the other lable......... If it is possible pls send me reply, I will be appreciated to you. Thanks and regards. shahzad |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't view worksheet contents, but I can do Print Preview and see | Excel Discussion (Misc queries) | |||
View Array Contents | Excel Programming | |||
spreadsheet contents have become hidden from view | Excel Discussion (Misc queries) | |||
Why can't I view the contents of a cell? | Excel Discussion (Misc queries) | |||
UserForm to view contents of spreadsheet | Excel Programming |