A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Discussion (Misc queries)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Manually changing a picture (shape) name property



 
 
Thread Tools Display Modes
  #1  
Old July 24th 08, 09:08 PM posted to microsoft.public.excel.misc
Ker_01
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


Ads
  #2  
Old July 24th 08, 09:35 PM posted to microsoft.public.excel.misc
Gary''s Student
external usenet poster
 
Posts: 11,059
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
>
>
>

  #3  
Old July 24th 08, 09:44 PM posted to microsoft.public.excel.misc
Dave Peterson
external usenet poster
 
Posts: 35,220
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
  #4  
Old July 25th 08, 12:57 PM posted to microsoft.public.excel.misc
Ker_01
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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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 03:31 AM
Legends - Changing the Shape of Paul Charts and Charting in Excel 2 January 4th 06 12: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 12:43 AM.


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