Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

range value as label caption

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pswanie - 19 Jan 2008 09:14 GMT
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
Rick Rothstein (MVP - VB) - 19 Jan 2008 09:33 GMT
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

>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
pswanie - 19 Jan 2008 10:26 GMT
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...
>
[quoted text clipped - 7 lines]
> >
> > 2) other just need to show sheet1 column b cell 25
Rick Rothstein (MVP - VB) - 19 Jan 2008 15:38 GMT
Label1.Caption = Cells(Cells(Rows.Count, "B").End(xlUp).Row, "B").Value

Rick

> thanx rick...
>
[quoted text clipped - 13 lines]
>> >
>> > 2) other just need to show sheet1 column b cell 25
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.