ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to identify a shape as a picture in excel from VB (https://www.excelbanter.com/excel-programming/404613-how-identify-shape-picture-excel-vbulletin.html)

Uwe

how to identify a shape as a picture in excel from VB
 
I have 600+ shapes in a spreadsheet. Half are the little red corner
associated with comments and half are small pictures in the same cell. How
can I select the picture in a given cell from VB?
--
Thanks,
Uwe

Dave Peterson

how to identify a shape as a picture in excel from VB
 
Hovering over some row or hovering over some cell?

Uwe wrote:

I have 600+ shapes in a spreadsheet. Half are the little red corner
associated with comments and half are small pictures in the same cell. How
can I select the picture in a given cell from VB?
--
Thanks,
Uwe


--

Dave Peterson

Ken Johnson

how to identify a shape as a picture in excel from VB
 
You could use the shape's name to distinguish Comment from other
shapes.
The following example selects the first shape in F2 whose name does
not start with "Comment"...

Option Explicit
Sub select_shape()
Dim Shp As Shape
For Each Shp In ActiveSheet.Shapes
If Shp.TopLeftCell = Range("F2") _
And Left(Shp.Name, 7) < "Comment" Then
Shp.Select
End If
Next
End Sub

Ken Johnson



All times are GMT +1. The time now is 07:29 AM.

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