Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"= Rectangle 1" Doesn't work!

Status
Not open for further replies.

shahyar

Chemical
Feb 15, 2005
216
0
0
CA
Hi,
How can I put content of a shape in a cell?
"= Rectangle 1" doesn't work. any Idea?

Thanks
 
Replies continue below

Recommended for you

um,
i no of no technique or process to "put content of a shape in a cell".
shapes are objects, which have physical characteristics (i.e. length, width, color, etc.) and in order to create them using vba, the creator must define the object + physical characteristics.
what you can do is create a rectangle the size of a cell by depressing the "alt" key when creating the rectangle. the rectangle will be sized that of the cell.

good luck!
-pmover
 
You can add text to autoshapes (insert a shape and right click to add text to that autoshape).
In order to get the text content from the autoshape you can use vba. Subsequent vba coding can place that text in a cell.
So, if you have the rectangle autoshape on your spreadsheet containing text then the following code extracts the text from the autoshape and places it in cell A1:

ActiveSheet.Shapes("Rectangle 8").Select
Selection.Characters.Text = "THIS IS A TEST"
Range("A1") = Selection.Characters.Text
 
The code should read:

ActiveSheet.Shapes("Rectangle 1").Select
autoshapetext = Selection.Characters.Text
Range("A1") = autoshapetext
 
You can put the content of a cell in the shape. Click on the shape, then click in the edit bar and type =A1 . The text will then change whenever the contents of A1 changes.
 
Status
Not open for further replies.
Back
Top