Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add a label at runtime
Hi,
Can anyone tell me how I can add a label to a form at runtime. Regards, Ron. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add a label at runtime
I don't know if you can do this, but you could create a label beforehand
with a blank caption then use Label1.Caption = "Test label" at runtime to populate it. -- Ian -- "Ron" wrote in message ... Hi, Can anyone tell me how I can add a label to a form at runtime. Regards, Ron. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add a label at runtime
Dim newCtl As msforms.Control
Set newCtl = Me.Controls.Add("Forms.Label.1") newCtl.Caption = "New Label" With newCtl .Left = 100 .Top = 50 .Visible = True End With -- HTH RP (remove nothere from the email address if mailing direct) "Ian" wrote in message ... I don't know if you can do this, but you could create a label beforehand with a blank caption then use Label1.Caption = "Test label" at runtime to populate it. -- Ian -- "Ron" wrote in message ... Hi, Can anyone tell me how I can add a label to a form at runtime. Regards, Ron. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add a label at runtime
If by form, you mean a userform:
Private Sub UserForm_Initialize() Dim LBL As MSForms.Label Set LBL = Controls.Add("Forms.Label.1", "Lable2", True) LBL.Top = 5 LBL.Left = 5 LBL.Caption = "abcd" End Sub -- Regards, Tom Ogilvy "Ron" wrote in message ... Hi, Can anyone tell me how I can add a label to a form at runtime. Regards, Ron. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Changing the font for part of an axis label, not the whole label. | Charts and Charting in Excel | |||
How to rezize data label box in pie charts (label wraps to two lin | Charts and Charting in Excel | |||
COPY LABEL FORM FROM EXCEL TO A LABEL | New Users to Excel | |||
how to remove label formatting (eg label to number) | Excel Worksheet Functions | |||
add text to label (label from forms toolbar) | Excel Programming |