Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Create shape, name shape, add text to shape

Hi, I decided to burst as many brain cells as I can working with shapes.
Its working. ;)

I am trying to add "Oval" shapes (msoShapeOval) tn image on a worksheet, the
problem I am having difficulties with is naming the shape or renaming the
shape as it is created.
I want to start with "Oval 1" for the First shape and continu counting, Oval
2, Oval 3, etc. What I get is what seems to be a random starting shape name
such as "Oval 6" when there are no shapes other than a picture shape on the
sheet or in the entire workbook.
Lets say It started with "Oval 6", I rename to "Oval 1" the next shape name
is going to be "Oval 7" by default; I can rename to "Oval 2" and so on until
I reach "Oval 12" and try to rename to "Oval 6". Instead of renaming it jumps
to the original "Oval 6" shape which was renamed to "Oval 1"?

1. Can I purge shapes from a worksheet or workbook?
2. How do I get the count to start where I want it to start at with out
duplicating the name?

--
Regards

Rick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Create shape, name shape, add text to shape

Set Disc = .AddShape(msoShapeOval, LimitLeft, TopShape, HeightShape,
HeightShape)
With Disc
.Fill.ForeColor.RGB = ColorBackground
.Line.Visible = msoFalse
.ZOrder msoSendToBack
.Name = "Oval 12"
End With

Note that if another shape named "Oval 12" exists you might have to code to
find it and rename it before creating this shape, but since you said that
there were no other shapes, this should work for you.

"Rick S." wrote:

Hi, I decided to burst as many brain cells as I can working with shapes.
Its working. ;)

I am trying to add "Oval" shapes (msoShapeOval) tn image on a worksheet, the
problem I am having difficulties with is naming the shape or renaming the
shape as it is created.
I want to start with "Oval 1" for the First shape and continu counting, Oval
2, Oval 3, etc. What I get is what seems to be a random starting shape name
such as "Oval 6" when there are no shapes other than a picture shape on the
sheet or in the entire workbook.
Lets say It started with "Oval 6", I rename to "Oval 1" the next shape name
is going to be "Oval 7" by default; I can rename to "Oval 2" and so on until
I reach "Oval 12" and try to rename to "Oval 6". Instead of renaming it jumps
to the original "Oval 6" shape which was renamed to "Oval 1"?

1. Can I purge shapes from a worksheet or workbook?
2. How do I get the count to start where I want it to start at with out
duplicating the name?

--
Regards

Rick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,180
Default Create shape, name shape, add text to shape

Excel 2007 Shape names
BGA example:
http://c0718892.cdn.cloudfiles.racks.../02_11_10.xlsm

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
Show shape on cell select, Hide shape when cell is deselected Max Excel Programming 5 January 27th 10 11:04 AM
Evaluating if a Shape is a line or a shape Sanjay[_2_] Excel Programming 2 April 30th 07 08:21 PM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Deleting a shape and the cell contents the shape is in. Dave Peterson[_3_] Excel Programming 1 October 9th 03 03:36 PM
Deleting a shape and the cell contents the shape is in. Tom Ogilvy Excel Programming 0 October 9th 03 03:43 AM


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