Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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
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
Can't view worksheet contents, but I can do Print Preview and see Beckster Excel Discussion (Misc queries) 1 August 1st 08 02:06 AM
View Array Contents Mike H. Excel Programming 3 October 12th 07 09:06 PM
spreadsheet contents have become hidden from view clive Excel Discussion (Misc queries) 2 March 23rd 06 08:40 AM
Why can't I view the contents of a cell? MOE26 Excel Discussion (Misc queries) 3 February 15th 06 12:12 AM
UserForm to view contents of spreadsheet mushybrain Excel Programming 2 February 16th 05 02:37 PM


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

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

About Us

"It's about Microsoft Excel"