Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Naming Auto Shapes and Creating new Shapes

When you create an AutoShape it is automatically given a name like Oval 1,
Oval 2, etc.

Is there a way to change the name that is assigned automatically so that it
is more meaningful, similar to range names?

Is there a way to find a list of all "shape" names on a particular worksheet?

If I wanted to create a special shape, say a smiley face, where the circle
could be filled. I would I go about creating, naming, and saving it?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Naming Auto Shapes and Creating new Shapes

To rename a shape, select the shape, then up where you see its name as Oval
1, Rectangle 2 etc (known as the Name Box) just highlight the current name
and type in the name you want it to have.

This macro will tell you the names of all shapes on a sheet:

Sub GetShapeNames()
Dim anyShape As Object
For Each anyShape In ActiveSheet.Shapes
MsgBox anyShape.Name
Next
End Sub

To put that into code: press [Alt]+[F11], choose Insert | Module from the VB
Editor menu and copy that code and paste it into the module. Then access the
routine from Tools | Macros | Macro in the main Excel window.

I'm afraid someone else will have to tell you how to add new shapes - that's
not something I know about, and I don't even know if it can be done.


"AL2000" wrote:

When you create an AutoShape it is automatically given a name like Oval 1,
Oval 2, etc.

Is there a way to change the name that is assigned automatically so that it
is more meaningful, similar to range names?

Is there a way to find a list of all "shape" names on a particular worksheet?

If I wanted to create a special shape, say a smiley face, where the circle
could be filled. I would I go about creating, naming, and saving it?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Naming Auto Shapes and Creating new Shapes

Renaming works as you describe. I had tried this but used a space. It appears
that even though the AutoShape names have a space, i.e. Oval 1, Oval 2, etc.
You cannot rename with a space.

The macro works great. Is there a way to paste them in a separate worksheet?

"JLatham" wrote:

To rename a shape, select the shape, then up where you see its name as Oval
1, Rectangle 2 etc (known as the Name Box) just highlight the current name
and type in the name you want it to have.

This macro will tell you the names of all shapes on a sheet:

Sub GetShapeNames()
Dim anyShape As Object
For Each anyShape In ActiveSheet.Shapes
MsgBox anyShape.Name
Next
End Sub

To put that into code: press [Alt]+[F11], choose Insert | Module from the VB
Editor menu and copy that code and paste it into the module. Then access the
routine from Tools | Macros | Macro in the main Excel window.

I'm afraid someone else will have to tell you how to add new shapes - that's
not something I know about, and I don't even know if it can be done.


"AL2000" wrote:

When you create an AutoShape it is automatically given a name like Oval 1,
Oval 2, etc.

Is there a way to change the name that is assigned automatically so that it
is more meaningful, similar to range names?

Is there a way to find a list of all "shape" names on a particular worksheet?

If I wanted to create a special shape, say a smiley face, where the circle
could be filled. I would I go about creating, naming, and saving it?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Naming Auto Shapes and Creating new Shapes

The macro will work on whatever worksheet you have activated at the time you
run it.

If you want it to go through all worksheets in a workbook:

Sub GetAllShapeNames()
Dim anySheet As Worksheets
Dim anyShape As Object
For Each anySheet in Worksheets
For each anyShape In ActiveSheet.Shapes
Msgbox AnyShape.Name & " in sheet: " & anySheet.Name
Next
Next
End Sub


"AL2000" wrote:

Renaming works as you describe. I had tried this but used a space. It appears
that even though the AutoShape names have a space, i.e. Oval 1, Oval 2, etc.
You cannot rename with a space.

The macro works great. Is there a way to paste them in a separate worksheet?

"JLatham" wrote:

To rename a shape, select the shape, then up where you see its name as Oval
1, Rectangle 2 etc (known as the Name Box) just highlight the current name
and type in the name you want it to have.

This macro will tell you the names of all shapes on a sheet:

Sub GetShapeNames()
Dim anyShape As Object
For Each anyShape In ActiveSheet.Shapes
MsgBox anyShape.Name
Next
End Sub

To put that into code: press [Alt]+[F11], choose Insert | Module from the VB
Editor menu and copy that code and paste it into the module. Then access the
routine from Tools | Macros | Macro in the main Excel window.

I'm afraid someone else will have to tell you how to add new shapes - that's
not something I know about, and I don't even know if it can be done.


"AL2000" wrote:

When you create an AutoShape it is automatically given a name like Oval 1,
Oval 2, etc.

Is there a way to change the name that is assigned automatically so that it
is more meaningful, similar to range names?

Is there a way to find a list of all "shape" names on a particular worksheet?

If I wanted to create a special shape, say a smiley face, where the circle
could be filled. I would I go about creating, naming, and saving it?

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
alternative coordinates for creating shapes David Macdonald Excel Discussion (Misc queries) 1 November 10th 06 04:10 PM
When drawing shapes in excel the shapes keep disappearing Tape Excel Discussion (Misc queries) 1 October 6th 06 04:23 PM
Creating shapes from given criteria Michael M Excel Worksheet Functions 0 April 26th 06 03:32 AM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM


All times are GMT +1. The time now is 08:13 AM.

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

About Us

"It's about Microsoft Excel"