View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default simple code, for each

Untested...
'--
Public Sub ReNamePics()
Dim Pic As Shape, K As Long
For Each Pic In ActiveSheet.Shapes
If Pic.Type = msoPicture Then
K = K + 1
Pic.Name = "pic" & K
End If
Next Pic
MsgBox "done"
End Sub
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"John"

wrote in message
I want to rename all 10 or so pictures in my worksheet...

Public Sub ReNamePics()
Dim Pic As Shape, K As Long
For Each Pic In ActiveSheet '<<<<<<<<< error here
K = K + 1
Pic.Name = "pic" & K
Next Pic
MsgBox "done"
End Sub