Picture question

M

meg99

I have a shape on my spreadsheet - "Oval 1". I imported a picture of
a football. I discovered the name for the football is "Picture 200".
My question is, how can I rename "Picture 200" to "Football 1"?

meg99
 
D

Dave Peterson

Select the picture
Notice that the name of the picture appears in the NameBox (to the left of the
formula bar)

Type the new name in the NameBox and remember to hit enter when you're done.
 
M

meg99

Select the picture
Notice that the name of the picture appears in the NameBox (to the left of the
formula bar)

Type the new name in the NameBox and remember to hit enter when you're done.

Thanks Dave. I can change the number so that Picture 200 becomes
Picture 1, but I can't change it to FootBall 1. I have a number of
other pictures and I would like to name them appropriately so I can
manipulate them in code without trying to remember the number. Is
that possible?

meg99
 
M

meg99

Thanks Dave. I can change the number so that Picture 200 becomes
Picture 1, but I can't change it to FootBall 1. I have a number of
other pictures and I would like to name them appropriately so I can
manipulate them in code without trying to remember the number. Is
that possible?

meg99- Hide quoted text -

- Show quoted text -

Another problem. After renaming Picture 200 to Picture 1, I now
notice that when I copy Picture 1 I get another Picture 1 instead of
Picture 2.
Before, when I had Pictrue 200, I could copy it and get Picture 201.

The app I am creating deletes all pictures except Picture 1 and then
copies Picture 1 at a computed cell. If all of the Pictures are
Picture 1, none of them get deleted.

Any clues?

meg99
 
G

Gord Dibben

Perhaps one of these will do the trick?

Public Sub ReNamePics()
'select all pictures then run
Dim Pic As Shape, K As Long
For Each Pic In Selection.ShapeRange
Pic.Name = Pic.Name & Pic.Name
Next Pic
For Each Pic In Selection.ShapeRange
K = K + 1
Pic.Name = "Football" & K
Next Pic
End Sub

Sub Rename_Pics22()
'select all pictures then rename with a list starting at A2
Dim Pic As Shape
Dim rng As Range
Dim i As Integer
On Error GoTo endit
Set rng = Range("A2")
For Each Pic In Selection.ShapeRange
Pic.Name = rng.Offset(i, 0).Value
i = i + 1
Next Pic
Exit Sub
endit:
MsgBox "there is a picture by that name, re-type a name"
End Sub


Gord Dibben MS Excel MVP
 
D

Dave Peterson

Try it again. You should be able to use that name. Remember to hit enter after
you type in the new name in the namebox.



meg99 wrote:
 
D

Dave Peterson

I like to use a unique name based on the topleftcell of the picture.

with worksheets("sheetnamehere")
'the last picture added
with .pictures(.pictures.count)
.name = "Pict_" & .topleftcell.address(0,0)
end with
end with

If that doesn't help, you may want to share more of your code.

Or maybe you can put the picture on a hidden sheet. Then you can delete all the
pictures and copy the single picture from that hidden sheet.

ps. You may have noticed that most people in the MS public excel newsgroups are
top posters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top