Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot Table Code - Simple Code Fix? | Excel Programming | |||
Help on some simple code | Excel Programming | |||
Simple VB code | Excel Programming | |||
simple code | Excel Programming | |||
Help With Very Simple Code | Excel Programming |