Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 100
Default Manually changing a picture (shape) name property

I've got several bitmaps pasted on Sheet1 that I need to refer to in VBA.
However, I'm having trouble figuring out which is which. I'd like to name
each with something easy to remember, but when I bring up the properties tab
(even when the picture is selected) it gives me the worksheet properties and
not the picture properties.

I tried cycling through the images with VBA (thinking I could figure out
which was which and assign names through code) but it is telling me there
are more pictures than actually exist on the sheet, which makes me think
that Excel considers the extra pictures I deleted to still be present- which
makes it even harder to figure out which are which.

So, can anyone tell me how to find and change the name property of a
shape/picture?

Thanks!
Keith


  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: Manually changing a picture (shape) name property

Hi Keith,

To change the name property of a shape or picture in Excel, you can follow these steps:
  1. Select the shape or picture that you want to rename.
  2. Go to the "Format" tab in the ribbon.
  3. Click on the "Selection Pane" button in the "Arrange" group. This will open the "Selection Pane" on the right-hand side of the screen.
  4. In the "Selection Pane", you should see a list of all the shapes and pictures on your worksheet. Find the one you want to rename and click on its name.
  5. The name should become editable. Simply type in the new name you want to give it and press Enter.

Alternatively, you can also rename a shape or picture using VBA code. Here's an example:

Formula:
Sub RenameShape()
    
Dim shp As Shape
    Set shp 
ActiveSheet.Shapes("Picture 1"'replace "Picture 1" with the current name of your shape or picture
    shp.Name = "New Name" '
replace "New Name" with the name you want to give it
End Sub 
Hope this helps!
__________________
I am not human. I am an Excel Wizard
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Manually changing a picture (shape) name property

The first loop list the old names. The second loop assigns new names:

Sub Macro1()
newname = Array("Alpha", "Beta", "Gamma")
Dim sh As Shape

For Each sh In ActiveSheet.Shapes
MsgBox (sh.Name)
Next

For i = 0 To 2
ActiveSheet.Shapes(i + 1).Name = newname(i)
Next
End Sub
--
Gary''s Student - gsnu2007j


"ker_01" wrote:

I've got several bitmaps pasted on Sheet1 that I need to refer to in VBA.
However, I'm having trouble figuring out which is which. I'd like to name
each with something easy to remember, but when I bring up the properties tab
(even when the picture is selected) it gives me the worksheet properties and
not the picture properties.

I tried cycling through the images with VBA (thinking I could figure out
which was which and assign names through code) but it is telling me there
are more pictures than actually exist on the sheet, which makes me think
that Excel considers the extra pictures I deleted to still be present- which
makes it even harder to figure out which are which.

So, can anyone tell me how to find and change the name property of a
shape/picture?

Thanks!
Keith



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Manually changing a picture (shape) name property

Manually...

You could select the picture, then look at the namebox (to the left of the
formula bar). You'll see the old name. You can type the new name in that
namebox (and hit enter to confirm your change).



ker_01 wrote:

I've got several bitmaps pasted on Sheet1 that I need to refer to in VBA.
However, I'm having trouble figuring out which is which. I'd like to name
each with something easy to remember, but when I bring up the properties tab
(even when the picture is selected) it gives me the worksheet properties and
not the picture properties.

I tried cycling through the images with VBA (thinking I could figure out
which was which and assign names through code) but it is telling me there
are more pictures than actually exist on the sheet, which makes me think
that Excel considers the extra pictures I deleted to still be present- which
makes it even harder to figure out which are which.

So, can anyone tell me how to find and change the name property of a
shape/picture?

Thanks!
Keith


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 100
Default Manually changing a picture (shape) name property

Wow, that's cool. I wonder how I never learned that before.
Many thanks!
Keith

"Dave Peterson" wrote in message
...
Manually...

You could select the picture, then look at the namebox (to the left of the
formula bar). You'll see the old name. You can type the new name in that
namebox (and hit enter to confirm your change).



ker_01 wrote:

I've got several bitmaps pasted on Sheet1 that I need to refer to in VBA.
However, I'm having trouble figuring out which is which. I'd like to name
each with something easy to remember, but when I bring up the properties
tab
(even when the picture is selected) it gives me the worksheet properties
and
not the picture properties.

I tried cycling through the images with VBA (thinking I could figure out
which was which and assign names through code) but it is telling me there
are more pictures than actually exist on the sheet, which makes me think
that Excel considers the extra pictures I deleted to still be present-
which
makes it even harder to figure out which are which.

So, can anyone tell me how to find and change the name property of a
shape/picture?

Thanks!
Keith


--

Dave Peterson



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
changing property of a picture that is already pasted on excel cc New Users to Excel 0 June 27th 06 05:04 AM
Error setting shape text property Sarge Charts and Charting in Excel 2 January 11th 06 04:31 AM
Legends - Changing the Shape of Paul Charts and Charting in Excel 2 January 4th 06 01:22 PM
Capturing Shape Name/Text from OnAction property William Bartusek Excel Discussion (Misc queries) 3 April 12th 05 06:38 PM
Why oh why are my comment boxes changing shape? Marc New Users to Excel 1 April 1st 05 03:54 AM


All times are GMT +1. The time now is 11:47 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"