linkedcell property

E

Emiliano

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
 
B

Bernard Liengme

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
 
E

Emiliano

No, I hav'nt a cell but a Label Control named lblMsg.
I have, however, solved the problem using a textbox control.
I think a label caption can't be linked to a cell value like
the textbox control can.

Thanks anyway,
Emiliano


Bernard Liengme a écrit :
 

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

Top