ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to retrieve the name of a picture within a worksheet? (https://www.excelbanter.com/excel-programming/286817-how-retrieve-name-picture-within-worksheet.html)

Oscar

How to retrieve the name of a picture within a worksheet?
 
How can I find out or edit the object name of a picture that I have added as
a picture file on a worksheet ?

Oscar



Tom Ogilvy

How to retrieve the name of a picture within a worksheet?
 
Depends on what the picture is. If it is a picture object (if you did
insert=Picture = from file it would be)


Activesheet.Pictures(1).Name

--
Regards,
Tom Ogilvy


Oscar wrote in message
ll.nl...
How can I find out or edit the object name of a picture that I have added

as
a picture file on a worksheet ?

Oscar





Colo[_56_]

How to retrieve the name of a picture within a worksheet?
 
Hi Oscar,
Only I know is looping...


Code
-------------------

Const msoPicture As Long = 13
Dim obj As Object
For Each obj In ActiveSheet.Shapes
If obj.Type = msoPicture Then
MsgBox obj.Name
End If
Next

-------------------


--
Message posted from http://www.ExcelForum.com


david mcritchie

How to retrieve the name of a picture within a worksheet?
 
This is looping to find the cell at a specific location:
Dave Peterson, posted in programming, 2002-06-16

Sub testme3()
Dim myCell As Range, myShape As Shape
Set myCell = Range("A1")
For Each myShape In ActiveSheet.Shapes
If Intersect(myShape.TopLeftCell, myCell) Is Nothing Then
'do nothing
Else
MsgBox myShape.Name
Exit For
End If
Next myShape
End Sub

Some other possibilities such as name of shapes in a selection,
and additonal information on Shapes can be found in
http://www.mvps.org/dmcritchie/excel/shapes.htm
--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Colo " wrote in message ...
Hi Oscar,
Only I know is looping...


Code:
--------------------

Const msoPicture As Long = 13
Dim obj As Object
For Each obj In ActiveSheet.Shapes
If obj.Type = msoPicture Then
MsgBox obj.Name
End If
Next

--------------------



---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 04:50 AM.

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