Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create shape, name shape, add text to shape
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Show shape on cell select, Hide shape when cell is deselected | Excel Programming | |||
Evaluating if a Shape is a line or a shape | Excel Programming | |||
my curser changed from arrow shape to a cross shape???? | New Users to Excel | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming |