Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default ShapeRange.Name

Dear All,

1) where can I get the name of a shape put in sheet? I usually create a
macro, select it, and I find the name in the vba code.
2) is possible to assign a specify name to a shape?

Thanks to anyone
M.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default ShapeRange.Name

Put some AutoShapes in a sheet and:

Sub qwerty()
MsgBox (ActiveSheet.Shapes.Count)
i = 0
For Each s In ActiveSheet.Shapes
MsgBox (s.Name)
s.Name = "mino" & i
i = i + 1
Next
End Sub

will tell:

1. you how many are there
2. their names
3. then re-name them
--
Gary''s Student - gsnu2007g


"mino" wrote:

Dear All,

1) where can I get the name of a shape put in sheet? I usually create a
macro, select it, and I find the name in the vba code.
2) is possible to assign a specify name to a shape?

Thanks to anyone
M.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default ShapeRange.Name

The last inserted shape will be the 'topmost' (assuming you haven't changed
order).

Dim shp as Shape
Set shp = ActiveSheet.Shapes(ActiveSheet.Shapes.Count) ' fails if no shapes
shp.Name = "newUniqueName"

See 'AddShape' in help and work with 'shp'
Set shp = ActiveSheet.Shapes.AddShape(arg's...
shp.name =

Regards,
Peter T


"mino" wrote in message
...
Dear All,

1) where can I get the name of a shape put in sheet? I usually create a
macro, select it, and I find the name in the vba code.
2) is possible to assign a specify name to a shape?

Thanks to anyone
M.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default ShapeRange.Name

Many Thanks to you and Gary"s

"Peter T" <peter_t@discussions ha scritto nel messaggio
...
The last inserted shape will be the 'topmost' (assuming you haven't
changed order).

Dim shp as Shape
Set shp = ActiveSheet.Shapes(ActiveSheet.Shapes.Count) ' fails if no
shapes
shp.Name = "newUniqueName"

See 'AddShape' in help and work with 'shp'
Set shp = ActiveSheet.Shapes.AddShape(arg's...
shp.name =

Regards,
Peter T


"mino" wrote in message
...
Dear All,

1) where can I get the name of a shape put in sheet? I usually create a
macro, select it, and I find the name in the vba code.
2) is possible to assign a specify name to a shape?

Thanks to anyone
M.





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
Excel 2007 and vb... ShapeRange.ScaleWidth problems Ken Excel Programming 1 October 11th 07 08:14 PM
Unselect shaperange object after drawing it with VBA? jedihe Excel Programming 2 July 28th 07 01:47 PM
Problem setting RGB Values with ShapeRange Bob Gibbons Excel Programming 4 August 26th 05 10:48 PM
Selection.ShapeRange.IncrementLeft error Anil Khemchandani Excel Programming 1 December 9th 03 09:29 PM
Selection.ShapeRange.IncrementLeft error Anil Khemchandani Excel Programming 0 December 9th 03 07:30 PM


All times are GMT +1. The time now is 10:25 AM.

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"