set label text of controlformat

  • Thread starter Thread starter hoho sklo
  • Start date Start date
H

hoho sklo

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

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

You might try this or some variation of it

ActiveSheet.Shapes("Label1").Select
Selection.Characters.Text = "abcd"
Range("F10").Select
 
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
 
thanks, but i want to do not use the select method.
namely,,,

lbl.value="dddddddd"

but this code not work.
 
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.
 
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
 
thanks, but, i want to do label control of controlformat..
oleobject is not...
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top