Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default range value as label caption

i got a few labels on a userform. most of them in a frame.

1) few of them need to show data in sheet1 colum a cell 1 untill empty row

2) other just need to show sheet1 column b cell 25
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default range value as label caption

You might consider using a ListBox for your first item; that way your users
would have a scroll bar to be able to view long lists. You could load it up
with code like this...

Dim C As Range
With Worksheets("Sheet1")
For Each C In .Range("A1:A" & .Cells(Rows.Count, 1).End(xlUp).Row)
ListBox1.AddItem C.Value
Next
End With

As for your second item, this will do it...

Label1.Caption = Cells(25, "B").Value

Rick


"pswanie" wrote in message
...
i got a few labels on a userform. most of them in a frame.

1) few of them need to show data in sheet1 colum a cell 1 untill empty row

2) other just need to show sheet1 column b cell 25


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default range value as label caption

thanx rick...

one more Q. how will i go to the last cell in column b and make that the
caption for label1?


As for your second item, this will do it...

Label1.Caption = Cells(25, "B").Value

Rick


"pswanie" wrote in message
...
i got a few labels on a userform. most of them in a frame.

1) few of them need to show data in sheet1 colum a cell 1 untill empty row

2) other just need to show sheet1 column b cell 25



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default range value as label caption

Label1.Caption = Cells(Cells(Rows.Count, "B").End(xlUp).Row, "B").Value

Rick


"pswanie" wrote in message
...
thanx rick...

one more Q. how will i go to the last cell in column b and make that the
caption for label1?


As for your second item, this will do it...

Label1.Caption = Cells(25, "B").Value

Rick


"pswanie" wrote in message
...
i got a few labels on a userform. most of them in a frame.

1) few of them need to show data in sheet1 colum a cell 1 untill empty
row

2) other just need to show sheet1 column b cell 25




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
label caption gramps Excel Discussion (Misc queries) 0 November 1st 07 03:56 PM
Label - Caption not changing Brian Hribek[_2_] Excel Programming 0 October 11th 04 10:02 PM
Label - Caption not changing Brian Hribek Excel Programming 1 October 11th 04 09:19 PM
changing the caption of a label Koos Excel Programming 4 October 18th 03 02:36 PM
label caption Rod Taylor Excel Programming 2 July 31st 03 03:25 AM


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