I am correct in reading your message to mean:
1) on the worksheet with the name "shname" you have a cell which has been
named lblMsg
2) you want to give this cell the value "my message"
If this is correct, please try:
Sheets("shname").Range("lblMsg").Value = "my message"
Note that Value can be omitted
Sheets("shame").Range("lblMsg") = "my message"
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email
"Emiliano" wrote in message
.. .
Hello,
I've a label on a ws named "lblMsg". I am trying to link its caption to
the value of a cell returned from a macro.
I've tried to place the following code in the macro itself:
sheets("shname").lblMsg.caption = "my message"
the statement is executed w/o errors, but the label caption is not
displayed.
I,ve also tried to set the linkedcell property from the ws activate event.
VBA shows this property and accepts it, but I get an error.
Any tip?
Thanks and best wishes to all.
Emiliano