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: 21
Default Userform Label question

Hello,

I have a form which contains 10 labels, named Lb1 to Lb10. The form has
a combobox and a command button. What I would like to is each time the
command button is clicked the text in combobox is added to the labels.

I've tried the following but it doesnt work.
sub commandbutton_click()
dim count as integer
dim lablename as string

count = 1

lablename = CStr(count) ' I thought I would need to cast the variable

Lb & lablename.caption = cblist.text

count = count + 1

' I will need to create a loop so that the count stops at 10.
end sub

Also I'm sure there's a much better way to do this. Could you create an
array of label names then loop through them using count?

Any help as always greatly appreciated.

David
 
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
Userform Label Steve[_9_] Excel Discussion (Misc queries) 7 October 29th 07 09:51 PM
Userform blinking label Ed Excel Programming 2 July 17th 04 12:24 AM
UserForm label doesn't load? Ed[_18_] Excel Programming 4 June 21st 04 07:53 PM
UserForm Label & Format Problems Mark Driscol Excel Programming 5 April 14th 04 08:33 PM
Making a TextBox look and feel like a Label in a userform Harald Staff[_4_] Excel Programming 2 July 30th 03 08:35 PM


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