RE: Identify shape in cell

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



This is not a simple problem. First shapes are not in cells but onto of
cells. You can get each shape with the following:

For Each shp In ActiveSheet.Shapes
Shapetext = ActiveSheet.OLEObjects(shp.Name).Object
For RowCount = 1 To Rows.Count
If Range("A" & RowCount).Top > shp.Top Then
ShapeRow = RowCount
Exit For
End If
Next RowCount
For ColCount = 1 To Columns.Count
If Cells(1, ColCount).Left > shp.Left Then
ShapeCol = ColCount
Exit For
End If
Next ColCount
Cells(ShapeRow, ShapeCol) = Shapetext
shp.Delete
Next shp

The problem then becomes which cell is closest to these shapes. Cells have
both Rows and columns as well as there pixel locations found with TOP & LEFT.
The pixel location change when you make columns and rows wider or narrower.
The shapes only have Top and Bottom.

"m" wrote:

I have a sheet that was populated with data from a table copied from a
website. One of the rows has cells which contain shapes rather than
text. I need to convert these shapes to text and delete the shapes.
Two questions:

How can I take the current selection and determine just what shape is
in it?
How can I delete that shape after I set the value property to the
desired text?

Something like TypeName(Selection) will tell me that I have a shape if
what is selected is the shape itself. I actually want to select the
cell (or a range of cells) and, based on this, figure out what the
shape might be.

Thanks!

-Martin


.



Relevant Pages

  • Re: PZ Myers sued for libel
    ... This is hardly an endorsement of magical self-organization. ... Is the spherical shape of many cells an example of self-organization, ... because natural selection has resulted in such a shape, ... If shapes of cells and simple organisms have no adaptive significance, ...
    (talk.origins)
  • Re: PZ Myers sued for libel
    ... of self-organization? ... because natural selection has resulted in such a shape, ... If shapes of cells and simple organisms have no adaptive significance, ...
    (talk.origins)
  • RE: Please help with my code
    ... It removes the shapes on the cells that I ... Dim cCount As Integer ... For Each cMarks In ActiveSheet.Shapes ...
    (microsoft.public.excel.programming)
  • RE: Please help with my code
    ... It removes the shapes on the cells that I ... Dim cCount As Integer ... For Each cMarks In ActiveSheet.Shapes ...
    (microsoft.public.excel.programming)
  • RE: Please help with my code
    ... It removes the shapes on the cells that I ... Dim cCount As Integer ... For Each cMarks In ActiveSheet.Shapes ...
    (microsoft.public.excel.programming)