Dim oleObj As OLEObject
For Each oleObj In ActiveSheet.OLEObjects
If TypeOf oleObj.Object Is msforms.Label Then
oleObj.Object.Caption = "hi"
End If
Next oleObj
or
Dim myShape As Shape
Set myShape = ActiveSheet.Shapes("label1")
myShape.OLEFormat.Object.Object = "hi there"
or maybe the easiest:
Worksheets("sheet1").Label1.Caption = "bye there"
--
Dave Peterson
ec3...@msn.com
ActiveSheet.Labels(1).Caption = "myCaption"
or
ActiveSheet.Labels("Label 1").Caption = "myCaption"
If you are talking about a label created using the Control Toolbox toolbar,
use the following:
ActiveSheet.OLEObjects(1).Object.Caption = "myCaption"
or
ActiveSheet.OLEObjects("Label1").Object.Caption = "myCaption"
--
John Green - Excel MVP
Sydney
Australia
"Steve Sacks" <Sa...@uconn.edu> wrote in message
news:b34101c2c0ff$1315bb60$8bf82ecf@TK2MSFTNGXA05...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!