How to enter a formula (cell reference) to a shape instead of text

L

LucaP

In Excel 2003 it was possible to set a reference to a cell to show the value
of that cell in a grouped shape:

WorksheetA.Shapes("ABC").GroupItems("ABC_DEF").Formula = "=" &
WorksheetB.Name & "!" & WorksheetB.Cells(1, 1).Address(RowAbsolute:=False,
ColumnAbsolute:=False)

How is this done in Excel 2007?

Thanks
 
H

Héctor Miguel

hi, Luca !
In Excel 2003 it was possible to set a reference to a cell to show the value of that cell in a grouped shape:

WorksheetA.Shapes("ABC").GroupItems("ABC_DEF").Formula = "=" &
WorksheetB.Name & "!" & WorksheetB.Cells(1, 1).Address(RowAbsolute:=False,
ColumnAbsolute:=False)

How is this done in Excel 2007?

i don't know what type of (grouped) shapes are you talking about (but...)
this is working for me in xl2007:

worksheeta.shapes("mygroup").groupItems("my2ndshape").oleformat.object.formula = "=" & worksheetb.name & "!a1"

hth,
hector.
 
L

LucaP

Hi Hector

Thanks for the input.
The solution works, but only if previously I remove (even a non-existing)
text:
worksheeta.shapes("mygroup").groupItems("my2ndshape").oleformat.object.text=
""

regards
Luca
 
H

Héctor Miguel

hi, Luca !
Thanks for the input.
The solution works, but only if previously I remove (even a non-existing) text:
worksheeta.shapes("mygroup").groupItems("my2ndshape").oleformat.object.text= ""

regards
Luca

thanks to you Luca, for the feed-back ;)

regards,
hector.

__ OP __
 

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