ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   set label text of controlformat (https://www.excelbanter.com/excel-programming/419201-set-label-text-controlformat.html)

hoho sklo

set label text of controlformat
 
dim lbl as controlformat.label
set lbl=activesheet.shapes("Label1")
lbl.text="abcd"

this code do not work..
How can I do work?



*** Sent via Developersdex http://www.developersdex.com ***

ShaneDevenshire

set label text of controlformat
 
Hi,

You might try this or some variation of it

ActiveSheet.Shapes("Label1").Select
Selection.Characters.Text = "abcd"
Range("F10").Select

--
Thanks,
Shane Devenshire


"hoho sklo" wrote:

dim lbl as controlformat.label
set lbl=activesheet.shapes("Label1")
lbl.text="abcd"

this code do not work..
How can I do work?



*** Sent via Developersdex http://www.developersdex.com ***


Mauro Gamberini[_3_]

set label text of controlformat
 
Private Sub m()
Dim lbl As Shape
With Me
Set lbl = .Shapes("Label 8")
lbl.Select
Selection.Characters.Text = "Pippo"
Set lbl = Nothing
End With
End Sub

--
---------------------------
Mauro Gamberini
http://www.riolab.org/
"hoho sklo" ha scritto nel messaggio
...
dim lbl as controlformat.label
set lbl=activesheet.shapes("Label1")
lbl.text="abcd"

this code do not work..
How can I do work?



*** Sent via Developersdex http://www.developersdex.com ***




hoho sklo

set label text of controlformat
 


thanks, but i want to do not use the select method.
namely,,,

lbl.value="dddddddd"

but this code not work.

*** Sent via Developersdex http://www.developersdex.com ***

Mauro Gamberini[_3_]

set label text of controlformat
 
thanks, but i want to do not use the select method.
namely,,,

lbl.value="dddddddd"

but this code not work.


...then don't use Forms Label, but
Control ToolBox Label.

--
---------------------------
Mauro Gamberini
http://www.riolab.org/



Peter T

set label text of controlformat
 
I'm guessing Label1 is a Label from the Controls toolbox menu, an ActiveX
control. If so try this -

Dim ole As OLEObject
Set ole = ActiveSheet.OLEObjects("Label1")
ole.Object.Caption = "hello"

Regards,
Peter T

"hoho sklo" wrote in message
...
dim lbl as controlformat.label
set lbl=activesheet.shapes("Label1")
lbl.text="abcd"

this code do not work..
How can I do work?



*** Sent via Developersdex http://www.developersdex.com ***




hoho sklo

set label text of controlformat
 


thanks, but, i want to do label control of controlformat..
oleobject is not...

*** Sent via Developersdex http://www.developersdex.com ***

Peter T

set label text of controlformat
 
Describe what you mean by "label control of controlformat"

If the object is on a sheet, which toolbar did you use to create it.

Regards,
Peter T

"hoho sklo" wrote in message
...


thanks, but, i want to do label control of controlformat..
oleobject is not...

*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 05:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com