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
0
Utf
2/26/2010 8:07:01 PM
excel.programming 6508 articles. 2 followers. Follow

2 Replies
1290 Views

Similar Articles

[PageSpeed] 9

        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
0
Utf
2/26/2010 9:04:02 PM
Excel 2007 Shape names
BGA example:
http://c0718892.cdn.cloudfiles.rackspacecloud.com/02_11_10.xlsm

0
Herbert
2/27/2010 7:11:05 PM
Reply:

Similar Artilces:

Replace a comma with a period in a cell containing a lastname, first name, middle i
Hello - I am trying to clean some data and need to change all of my names from McLaughlin, Victor, (i.e, comma) W to McLaughlin, Victor.(i.e., period) W Is there an extract and replace formula or method of som sort (in excel or access) that will allow me to pull the first comma from the right and replace it with a period. Thanks for any suggestions! Select the cells you want to change and run this tiny macro: Sub comma_tose() For Each r In Selection v = StrReverse(r.Value) r.Value = StrReverse(Replace(v, ",", ".", 1, 1)) Next End Sub For example: a,b,c,d wi...

Need help in accessing a sharepoint site that I created with the AllTemplates.exe
SBS2008 with WSS 3.0 I downloaded the AllTemplates.exe from Microsoft and installed the Helpdesk template. I can acess the Helpdesk site from SBS2008 and add things to it but I can't access it from a workstation. Can anyone help me out? Thanks You mean you can only access the site from the Server in local , right? maybe we need more information such as error message. how about doing "ping" or "tracert" result. can you access a normal web site (not sharepoint site) from the workstation ? do you get an authentication window ? "john doe" wr...

Getting Data Shapes to Work with Custom Stencils
I imported a picture and saved it as a shape. Then I linked data from a SQL database. I can get the data to show up in the Shape Date, but I can't get a Data Graphic to appear. Note that I can get Data Graphics to work with out of the box shapes in the same drawing - just not the custom picture. Tried in both Visio 2007 and 2010 Beta. What am I doing wrong? Thanks in advance. ...

SMTP domain name
Hello. I am running Exchange 5.5 SP4 on a windows 2000 machine and a windows 2000 native domain. Problem I am having is complaints from people regarding the smtp domain name. Our Public domain name and our AD domain name are different. Helo response from the server returns the AD domain name and not the public domain name. This is causing messages to be rejected by some SPAM filters. Has anybody had this problem? Thanks Yes I have battled long and hard with this problem. First thing to check is Exchange System Manager, "Default SMTP Virtual Server" look in advanced propertie...

Creating a Campaign Response via Follow-up
When you create a new Task/Phone Call or other activity via the Follow-up tab, the new Activity is associated with the entity you are looking at. (so following up a Contact with a Phone Call will create a Phone Call which is associated with the Contact) This is not the case for the Campaign Response activity - when you create a Campaign Response via the Follow-up tab, the Customer field (ie regarding) is left blank and hence not associated with anyone. Presumably this is a bug - anyone know if there is a hotfix for this? Kind Regards, Paul. ...

Add Word and change format
1) Let say colomn A is a product codes, such as "PK0021", "UQ05P8", etc...Now I want add a "Z" in front the codes. To be "ZPK0021, ZUQ05P8". What's the faster way in case I got thousand of codes? 2) In my colomn B is such code as "18-521-65, 18-81-84, 18-1112-65" and etc. Now I would like to make it to be standard to 4 digit for the middle number to be "18-0521-65, 18-0081-84, 18-1112-65" ... As the same senario as above, I got more than thousand of such codes... What's the faster way? Kelvin The first could be done wi...

zoom on RTF text
Hi all, I am currently developing a windowless textbox object using ITextServices. Everything went very well until performed zoom on text. In my code the RTF text is rendered using TxDraw, which calculates zoom factor as this: zoom factor = (pixel height of client rect)*2540/[Himetric vertical extent]*[pixel per vertical inch]. But the result wasn't really that good, the scaled text often went out of box, and word wrap wasn't consistent specially when it scaled below 60%(above 100% much better). Does anybody know what problems caused it? Any input would be appreciated. Thanks. jm H...

Replace Cells with Column names in functions?
I have a # of fairly long/complex cell functions that get hard to debug because there are also a lot of rows. Is there anyway to change display so it replaces the column name e.g. If(BT1204="X". BA="Y" to If(CustomerName="X", CustomerCode="Y") ? CustomerName is a defined name range for BT1204 Find & Replace Find what: BT1204 Replace with: CustomerName "msnyc07" wrote: > I have a # of fairly long/complex cell functions that get hard to debug > because there are also a lot of rows. > > Is t...

Text to dates
I have a column of dates F6:F148, the dates have been entered in the following formats all entered as text "21.01.2009","21.1.2009","21 Jan 09" & "21 Jan 2009". I'd like to be able to change them all into a common date format 21 Jan 09 (I'll also change the sheet so that data is validated to this date format) Does anyone know a way I can do this? Thanks You can use the 'Convert Text to Columns Wizard to convert the dates --Select the range of dates which needs to be corrected. --From menu Data>'Text to Col...

Creating a summary sheet
I have a spreadsheet that is about 200 rows down and 60 columns accross. I want to create a second summary tab that will pull over only certain columns from the "detail" sheet. As I update the detail sheet I want to also update the summary sheet - so far no problem, but if I add a new row in the detai sheet - how can I also add the same row in the summary sheet and only bring over columns I want on the summary sheet (the columns are not next to each other) Paste link does not insert the row in the summary sheet unless I drag the formulas - which I do not want to do. Is th...

Display names in Contacts
When I create a new contact and after that I type the email address, then Display name is written like this : LastName FirstName(email). Is there a setting that I can change to eliminate the email address in the display name ? I would like to have the display name showing like this : LastName FirstName . Antoine Veilleux Change the 'Display as' setting when creating new contacts. "Shidewa" wrote: > When I create a new contact and after that I type the email address, > then Display name is written like this : LastName FirstName(email). Is > there a settin...

address being appended to contact's name
If this is not the proper newsgroup for windows mail, please direct me to it. When I create or forward email, the email address is appended to the name of the contacts in the "To:" line. How can I stop this from happening? Thanks, Jim B. Vista's Windows Mail? microsoft.public.windows.vista.mail "Jim Birke@yahoo.com>" <jimbir<nottthis> wrote in message news:#RKwAWMuKHA.4796@TK2MSFTNGP02.phx.gbl... > If this is not the proper newsgroup for windows mail, please direct me to > it. > > When I create or forward email, the email...

Cannot select a range of text
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I am unable to select a range of text with either the track pad or my mouse. I am able to double- or triple-click to select, and can use keyboard commands to select all, etc. <br><br>This is a new problem that has not existed before. <br><br>Thanks! <br><br>Art Hi Arthur: Not enough information to answer. Please carry out some diagnostic testing for us: 1) Is this one document, several documents, or all documents? 2) Is this both .doc and .docx? If not, which ...

Can I use VBA to add cells (over blanks) then do multiplication
I have a Word table in which the last column contains numbers (3 and 4) and some bank cells and I want it add them and put the total into the second last row (7 in this case). The last row contains a multiplier (3) which when applied to the total results in 21. Below is the table. | | | 3 | | | | | | | | 4 | | | | 7 | | | 3 |21| How can I achieve this in VBA (under Word 2003 and 2007) remembering that the user can add rows to the table and the last column can contain blank cells. Thanks in advance for any assistance, Peter Evans Sub ScratchMaco(...

choice to colour text
Hi, hope someone can help. I have a shared spreadsheet with quite a lot of users. I need to categorise who is using the spreadsheet so that text that they add comes up in a different colour. Is there anyway to do this? I realise they could just change the text colour themselves, but it would be simpler in the long run if when they tried to input text they were faced with a question, and the answer changed the text colour automatically. Any help is much appreciated! Nick Hi, Maybe a user has to log in to the worksheet. eg when the sheet opens, an input box asks for username. The a...

How to add a host in safe sender list
Dear ALL, How can i config IMFv2 to unblock all emails sent from a specific host in my company? eg. all emails sent from 10.0.0.1 should not be blocked. Thanks a lot - Add it to the Connection Filtering - Global Accept list: Global Settings | Message Delivery properties | Connection Filtering | Accept. - Enable Connection Filtering in SMTP virtual server properties | General tab | Advanced | select IP(s) | Edit | Apply Connection Filter. -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: www.exchangepedia.com/blog ---------------------------------------------- "...

Problem with Text box and Background
I am using the background as a temple for a form I add test boxes where I want to have text typed in The problem is when I print the page the text I have typed in isn't where it is supposed to be It is below the line of the background form How do I solve this problem? Web page? Best asked in the publisher.webdesign group -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "News" <gmhull@sbcglobal.net> wrote in message news:pOKFf.27487$F_3.19174@newssvr29.news.prodigy.net... >I am using the background as a t...

How do I change the text size in a drop down box
I am using excel 2003. It seems to default to 10pts. Changing the size in the source list or the default in the general tab did not change the size. ...

VBA to add and remove text within cells
Hi, I have a field named "Postal" at the top of column F that always include a number with 5 digits then a city name then a region name, such as "11090 CARCASSONNE Linguadoca-Rossiglione". I need to create a program to have this field changed as following : "F-11090", then copying "CARCASSONNE" into the City field which is empty (column G). The city name is always starting just one space character after the postcode, same thing for the region name, it always starts one space character after the city name. The region has to be removed completely. ...

Dialog text only updated on mouse moves
My PreTranslateMessage() function has code in it to update some of the text in one of my dialog boxes. It works, but instead of updating it every second, it only udpates the text when my mouse is moving or clicking. Any ideas on what might be causing this? Thank you! Well, that's becuase PreTranslateMessage gets called only when there is message in the queue for that window. Instead use a timer. See OnTimer (WM_TIMER) AliR. <PloutzMR@Npt.NUWC.Navy.Mil> wrote in message news:1154456910.215194.170930@s13g2000cwa.googlegroups.com... > My PreTranslateMessage() function has c...

text boxes that label axes in line/scatter graphs
I tried to use "SAT-M" as y-axis label, but "M" was cut off (actually went to second line that could not be seen). I tried every trick I know to lengthen the text box, to fit label on one line. Hi, The only way to length chart textboxes is with more text. But at some point more text will cause the content to wrap. The charts textboxes do not have the ability to be sized manually even though the bounding box and grab handles would suggest otherwise. Try adding a few spaces or even non-breaking spaces ALT+0160 (Numpad) Cheers Andy Peg wrote: > I tried to use &qu...

Should be able to create recurring service activities
It would be nice to be able to create recurring service activities and appointments. We use the shared service calendar and other members of my team cannot see when i am carrying out the month end routine each month unless i manually create an appointment for it. It would be most helpful if you could create a recurring appointment or service activity within crm to save time each time you have the same activity. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree&q...

Concerning the shapes:
"When I change the sizes in the Organization Chart -> Options menu it applies them to all the shapes. But I want the executives, managers and "normal" employees to have a different size :( Is there any possibilty to do so? Thanks a lot" This question was brought up a while ago.... I too am having this problem, is there a work around for this other then having to make each shape individually??? What a freaking pain in the butt,, I have over 400 hundred positions that I am doing... R~ ...

Outlook 2003-Failing remember name when typing into the To: field
I just got Outlook 2002 and I was informed that when you send a message and typing in the To: field that if you have emailed someone before it would remember the name. For example: If I send an email to Shawn Hedrick the next time I send one I would only have to type maybe the first few letter and then it would prefill the rest. Does anyone know about this or how to set this up? tools, options, email options, advanced options - is suggest names checked? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStar...

Automatique Shape
Bonsour´┐Ż, ;o))) useless experiments!!! I challenge the do-it-yourselfers and nutcases about VBA... (API, BdR,Xla modification ???) Is it possible to modify the properties of the automatic shapes ????? example: ActiveSheet.Shapes.AddShape(msoShapeMoon, 28.5, 252 #, 81.75, 115.5).Select Selection.ShapeRange.Adjustments.Item(1) = 0.875 in this example "Crescent of the moon" I wish that the "adjustements.item(1)" be able to accept a value higher than 0.875 i-e has to be variable on range [ 0% to 100% ] crescent initiate to full half-circle thank you @ + FU2 microsoft.p...