View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Greg Koppel Greg Koppel is offline
external usenet poster
 
Posts: 79
Default Easy one: getting the name of a picture

Not sure what you really want, but here is some code to play with that lists
all the picture names and gives the number of the last picture.

Sub test()
List = ""
Num = Sheets(1).Shapes.Count
For i = 1 To Num
List = List & Sheets(1).Shapes(i).Name & Chr(13)
Next i
MsgBox List
MsgBox Right(Sheets(1).Shapes(Num).Name,
Len(Sheets(1).Shapes(Num).Name) - 7)
End Sub

HTH, Greg


"Paul" wrote in message
...
Hi,

I need to insert a picture into excel and then extract the
numeric value from it's default name. For example, if you
create a new workbook and insert a picture, the picture
name will be "Picture 1". I need to extract the "1" from
that name, so that I can assign it to the the starting
value of a loop counter (don't ask...)

TIA
Paul