ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to enter a formula (cell reference) to a shape instead of text (https://www.excelbanter.com/excel-programming/417980-how-enter-formula-cell-reference-shape-instead-text.html)

LucaP

How to enter a formula (cell reference) to a shape instead of text
 
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").For mula = "=" &
WorksheetB.Name & "!" & WorksheetB.Cells(1, 1).Address(RowAbsolute:=False,
ColumnAbsolute:=False)

How is this done in Excel 2007?

Thanks

Héctor Miguel

How to enter a formula (cell reference) to a shape instead of text
 
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").For mula = "=" &
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("my2ndshap e").oleformat.object.formula = "=" & worksheetb.name & "!a1"

hth,
hector.



LucaP

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

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

regards
Luca


"Héctor Miguel" wrote:

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").For mula = "=" &
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("my2ndshap e").oleformat.object.formula = "=" & worksheetb.name & "!a1"

hth,
hector.




Héctor Miguel

How to enter a formula (cell reference) to a shape instead of
 
hi, Luca !

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

regards
Luca


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

regards,
hector.

__ OP __
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").For mula = "=" &
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("my2ndshap e").oleformat.object.formula = "=" & worksheetb.name & "!a1"





All times are GMT +1. The time now is 04:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com