Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default simple code, for each

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default simple code, for each

Thanks Jim Im in portland too

"Jim Cone" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default simple code, for each

Public Sub ReNamePics()
Dim Pic As Shape, K As Long
ActiveSheet.DrawingObjects.Select
For Each Pic In Selection.ShapeRange
K = K + 1
Pic.Name = "pic" & K
Next Pic
MsgBox "done"
End Sub


Gord Dibben MS Excel MVP

On Tue, 3 Jun 2008 19:48:00 -0700, John wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Code - Simple Code Fix? J.W. Aldridge Excel Programming 2 April 4th 08 02:24 PM
Help on some simple code Tim Excel Programming 9 September 14th 07 03:29 PM
Simple VB code cjupiter Excel Programming 3 January 25th 06 01:08 AM
simple code gavmer[_5_] Excel Programming 4 May 19th 04 03:32 AM
Help With Very Simple Code pauluk[_17_] Excel Programming 7 April 8th 04 10:45 AM


All times are GMT +1. The time now is 05:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"