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: 226
Default View Listbox items in the Label

Hi Shahzad

One way to do this would be to have 7 labels with the standard names
i.e. Label1, Label2 then to use a loop to pass the value to the
caption of the Label controls. I have included the code below.

Option Explicit
Dim Ctrl As Control
Dim iNdx As Integer
Dim i As Integer

Private Sub ListBox1_Click()

iNdx = ListBox1.ListIndex

For i = 1 To 7

Set Ctrl = UserForm1.Controls("Label" & i)

Ctrl.Caption = ListBox1.List(iNdx, i - 1)

Set Ctrl = Nothing

Next

End Sub

I hope this helps

Steve

 
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
label on top of a listbox CG Rosén Excel Programming 2 October 2nd 07 07:27 PM
View List Items in Combo Box rl Excel Worksheet Functions 6 May 17th 07 12:53 AM
add items to listbox Baha Excel Programming 1 November 24th 06 01:44 AM
Adding Items to a ListBox-Unique Items Only jpendegraft[_14_] Excel Programming 2 May 2nd 04 02:27 AM
Items in a Listbox Todd Huttenstine Excel Programming 1 April 26th 04 03:36 PM


All times are GMT +1. The time now is 10:38 PM.

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"