Delete a rectangle using a macro

I'm trying to delete rectangles from 170 worksheets in a workbook.  I
tried highlighting each worksheet and it won't allow me to make the
change.  I tried recording a macro to perform the function,  but there
is an error message that says the rectangle is not found.  Does anyone
know how to change this statement to have the macro run?

ActiveSheet.Shapes("Rectangle 4").Select
    Selection.Characters.Text = _

0
cailotto (11)
9/29/2005 6:26:07 PM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
378 Views

Similar Articles

[PageSpeed] 41

This deletes all the rectangles in the active workbook.

Sub DelRects()
    Dim WS As Worksheet
    For Each WS In Worksheets
        WS.Rectangles.Delete
    Next
End Sub

I don't think that's what you want to do but at least this will give you an 
opportunity to clarify.

-- 
Jim
<cailotto@sbcglobal.net> wrote in message 
news:1128018367.655325.326710@o13g2000cwo.googlegroups.com...
| I'm trying to delete rectangles from 170 worksheets in a workbook.  I
| tried highlighting each worksheet and it won't allow me to make the
| change.  I tried recording a macro to perform the function,  but there
| is an error message that says the rectangle is not found.  Does anyone
| know how to change this statement to have the macro run?
|
| ActiveSheet.Shapes("Rectangle 4").Select
|    Selection.Characters.Text = _
| 


0
jrrech (1933)
9/29/2005 7:17:25 PM
there is a good chance that the rectangle has a different name on each sheet.
if you want to delete all shapes on a sheet

Sub spdel()
For n = ActiveSheet.Shapes.Count To 1 Step -1
ActiveSheet.Shapes(n).Delete
Next n
End Sub

you can make it more complex by looking for Rec in the name of the shape if 
it os only retangles you want to delete

"cailotto@sbcglobal.net" wrote:

> I'm trying to delete rectangles from 170 worksheets in a workbook.  I
> tried highlighting each worksheet and it won't allow me to make the
> change.  I tried recording a macro to perform the function,  but there
> is an error message that says the rectangle is not found.  Does anyone
> know how to change this statement to have the macro run?
> 
> ActiveSheet.Shapes("Rectangle 4").Select
>     Selection.Characters.Text = _
> 
> 
0
BJ (832)
9/29/2005 7:21:03 PM
Reply:

Similar Artilces:

Cannot delete subreport
I am using Access 2003 and have a report I did a while back with a simple subreport. I want to remove the subreport but for the life of me can't figure out how to do it. Any help would be greatly appreciated. Thanks. Hi - When you say "remove the sub report", what do you mean? Do you want to delete the entire subreport control containing the subreport, or do you want to keep the control, but change the report contained in it? The first is easy - select the control by clicking once on it once, then press delete. For the second, click the control once, then set ...

Using Popups to select a range of cells.
Hi All I have a small request for help with code. I need a macro to have popups request the first and last cells in a range , and then to select them. Can someone help? Sub test() Dim Rng As Range On Error Resume Next Set Rng = Application.InputBox("Select your range", _ "Mousework", Type:=8) On Error GoTo 0 If Rng Is Nothing Then Exit Sub MsgBox Rng.Address End Sub HTH. Best wishes Harald "Colin Hayes" <Colin@chayes.demon.co.uk> wrote in message news:8mYkILA1YlvLFw7Z@chayes.demon.co.uk... > > Hi All > >...

Need Assist with Macro
I want to import manual PM checks. Since IM v10 no longer has a direct-to-table adapter (thanks, MS :)), I would like create a mail merge macro for the task. I am having trouble with the Apply Payables Document window and the "need" to specify the line number (i.e. MoveTo line 2, TypeTo line 2, etc.). Anyone know how to get around having to specify the line number? This is the test macro I have thus far which works with TWO. Thanks in advance. # DEXVERSION=10.0.320.0 2 2 CheckActiveWin dictionary 'default' form 'PM_Manual_Payments' window 'PM_Manual...

How to Recover Deleted Sent Mail?
While trying to delete very old "Sent" mail I seem to have deleted all "Sent" mail. Is there a way of recovering this mail? Have you closed Outlook since deleting the old sent mail? http://www.howto-outlook.com/howto/restoredeleteditemsfromanoutlookpst.htm might help. Next time, archive the items you want removed from your active .pst file. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, Sidney Friedman as...

Using VBA to create tasks
I am trying out creating tasks in VBA. This works fine. I have tried to implement VBA to monitor incoming mails and converting them to tasks based on some criteria. But this does not seem to be working. My code is based on the following article: http://support.microsoft.com/default.aspx?scid=kb;en- us;235852 which allows users to add ItemAdd event to outlook to monitor incoming mails. This event(ItemAdd) does not seem to be firing at all. If anyone has tried this one out and have it working, please let me know what I am doing wrong. I am using MS Outlook 2000 Client btw. Thanks, ...

Rule for Deleted Items
I am being told that there is a rule in place on my Exchange server that will not empty the deleted items folder every 30 days for certain users in my organization. I found a recipient policy in System Manager that says "Users Excluded from Mailbox Cleanup" but it only shows 2 users and not the 3 I was told about. But I have confirmed that the missing person has email in her deleted items folder going back to 2005 so it must be working. Is there any other location I should be looking? Also, we just had someone come in and migrate our Exchange environment from 2000 to a new...

cannot delete message from deleted items
I have a message in my deleted items folder that when choosing delete opens the McAfee box warning of potential virus and wants me to choose open or do not open, but will not delete. I have tried choosing another file and holding ctrl and choosing the file I want deleted and then choosing delete, I have tried moving it to the desktop but it will only copy there, I have tried every form of delete possible. I need help. Anyone know how? Outlook 2002. Can you empty the deleted items folder entirely? Or turn off the McAfee scanning temporarily to see if it makes a difference? Julie wr...

I can not delete a duplicate personal folders list #2
Vall... amazing that there isn't an easy fix for this. The instructions provided simply don't work ( tools-email accounts-view change email accounts-deliver to new account-finish-close outlook and reopen ), and none of the other offered explanations have worked either. As this is such a common problem; why hasn't microsoft provided a very EASY fix? I am more confused ( and frightened ) and don't want to make the problem worse! Your profile is corrupt, probably based on an incorrect migration of your ..pst file. Create a new mail profile and configure it to use your exi...

INF for Ports class CDC USB device using usbser.sys fails DTM INFT
If a USB-to-serial CDC ACM specification device using usbser.sys is not classified as a modem, the New Hardware Wizard will not install the Virtual COM Port unless the INF file AddService directive Flags parameter has a value of 2 to set the SPSVCINST_ASSOCSERVICE bit. This causes both ChkInf and the DTM "INFTest for a single .INF" to fail with error "(E.22.1302) Filter drivers cannot be the controlling service (SPSVCINST_ASSOCSERVICE)." To certifiy the driver for a device that otherwise passes WINQUAL testing but is less complicated than a modem, is there any...

Retrieval of Deleted Items After Being Deleted from the Deleted Items File
I deleted a number of important emails from the deleted items file in Outlook 2000. This may sound stupid, but I completely emptied the deleted items file instead of deleting them one by one. Pretty stupid, huh. Anyone. Can they be retrieved? Please help. Thanks. Sorry for sending this again but I seem to be computer illiterate and it has taken me some time to explain the whole situation. Thanks again. unless you use Exchange server with deleted retention enabled, you are most likely out of luck, but you can try something that might help.... http://www.outlook-tips.net/howto/r...

Using c# object in Excel VBA
Hi All I have writen an COM Object in C# to use it in Excel. This Object has a Function that delivers a List of Users from a Database. My problem is now that I get the List of Users but it is not posible to get one of the Properties of the User. But when I create a new Object with Set user = CreateObject("GuptaIntferface.UserVOCom") I can see all Properties of this object. My Question is now how can I tell VBA now that the objects in the List are the UserVOCOM Objects? thx for help Michael I'm kind of stabbing the dark on this one as I've never worked with a C...

Delete macros
I am using Excel 2002. When I click on Tools->Macro->Macros... i see 2 macros. The problem I am having is that I can't delete these macros, the delete button to the right is grayed out. How can I delete these macros? Hi maybe the macros are protected. Try hitting ALT + F11 to open the VBA editor and try to delete the macros / modules there -- Regards Frank Kabel Frankfurt, Germany excel777 wrote: > I am using Excel 2002. When I click on Tools->Macro->Macros... i see > 2 macros. The problem I am having is that I can't delete these > macros, the delete button to ...

using data from one sheet to another
Hi I want to keep a running balance in a budget , month on month and I understand that its not best to use an accumalator. I was advised to have twelve separate tabs which is fine and I have copied the sheet to the next tab but I don't know how to link cells from one sheet to another. Can anyone help please, and yes I am an absolute beginner. Thanks -- Deb Assuming that by "a budget" you mean a checkbook type account where the present balance is continually calculated down the page then try something like: =LOOKUP(2,1/Sheet1!H1:H1000,Sheet1!H1:H1000) This will retur...

Go to the begining of the txt file after using getline()
Go to the begining of the txt file after using getline() I use fstream, open() and getline() to take a whole line from the text file. I would like to know how I can set the value of the file pointer to the beginning of the file without closing (with close() ) to start using getline() again. I need to do it many times and I think that making that without closing and reopening file thousands times will save much time. Could you advise me. Alur fseek(fileptr,0,SEEK_SET); AliR. "Alur" <Alur@discussions.microsoft.com> wrote in message news:CD7B7AFF-6057-4C37-955A-CADA73781B3...

deleting email in outlook, freezes before i can delete
i have a file with pics that symetec scanner says is to large. i can receieve email but cannot send any. it freezes before i can delete and says non responding. Hi All, I want to re-raise the old issue of Fax numbers showing up in the Outlook Address book when one is sending an email. I know that this can be stopped by prepending the Contact's fax number with a letter so that Outlook doesn't see it as a valid fax number and therefore doesn't list it. What's always puzzled me, however, is that this fix doesn't work if the fax numbers are changed using an export to CSV...

OK to delete Deleted Items folder?
I'm afraid I'll have to delete my Deleted Items folder in Outlook 2000. When I try to empty the folder I get a "The messaging interfce has returned an unknown error. If the problem persists Restart Outlook" message. Is it possible to delete the entire folder and replace it with an empty new one? Will it create any problems? TIA Henrik Not possible. Run scanpst.exe against your pst-file to scan it for errors first. -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -What do the Outlook Icons Mean? -Create an Office 2003 CD slipstreamed with Se...

use bahttext function in english language
please let me know how do i convert bahttext into english text You can't. See http://www.mvps.org/dmcritchie/excel/strings.htm#numberstowords In article <CEEFD6B0-15EE-429B-8F7D-11DDBD166F43@microsoft.com>, "rabih" <rabih@discussions.microsoft.com> wrote: > please let me know how do i convert bahttext into english text Hi http://www.j-walk.com/ss/excel/odd/odd20.htm :-)) Arvi Laanemets "rabih" <rabih@discussions.microsoft.com> wrote in message news:CEEFD6B0-15EE-429B-8F7D-11DDBD166F43@microsoft.com... > please let me know how do...

How to delete chart
I created a histogram and want to delete it. I select it and the faint double border apperars. There are no square handles like in 2003. Then I press the Delete key. The faint double border goes away replaced by a single thin black border. The chart is still there and is not able to be selected at all. I entered "delete chart" in the Excel Help window, and there was nothing at all on deleting a chart. Ditto for "remove chart." I got no help searching on the internet either. I have Excel 2007 and Windows XP Professional When the border changes, can you press Delete a...

Migrating Macros to new log-on
We've just been migrated to new servers, and with them came a new log-in. I had a whole bunch of macros under my old log-in, and if I go back to it, they're still there. How can I move them to the new log-in? If I just have to re-key everything I can do that, but I hope there's an easier way. I'm using Excel 2000 on an XPSP2 system. Thanks in advance. Macros can live in the workbooks in which they were created or in Personal.xls. You also could have placed the macros in a workbook and saved it as an Add-in(*.xla) If in Personal.xls, you must find that file a...

Delete blank Last page
In a word document where the last page is blank due to editing or whatnot, how do you get rid of the frigg' thing. This is a Visio newsgroup - your question was about Word. However, I have had this problem as you have. Narrowing the margins and line spacing on the page previous to the last may get rid of this annoying "blank" page for you. - Jeff Chapman "silkies" <silkies@discussions.microsoft.com> wrote in message news:BDCC1FF1-50D0-42CE-BA84-868CB26A43AC@microsoft.com... > In a word document where the last page is blank due to editing or > whatnot...

Recovering Unrecoverable Deleted Public Folders
Long, sad story with a punch line (which is worth getting to): Exchange 2003. Ran into a situation where a user deleted 10 public folders by mistake. Using Recover Deleted Items to retrieve them, got back five of the folders (the ones that were empty in the first place) but we received the following error message when attempting to recover the other five (the ones with actual stuff in them): "Outlook was unable to recover some or all of the items in this folder. Make sure you have the required permissions to recover items in this folder and try again. If the problem persists contact you...

How to generate reports using certain accounts
Hello all, I am using MS Money Plus Deluxe. I inputed my online Banking logon information and MS Money retrives all of my accounts linked to that logon (5 accounts). Now there are only two accounts that I want to have MS Money manage and generate reports for. I have "closed" the remaining 3 accounts within MS Money so that the two I want are showing as open. However, when I choose to generate a monthly report it includes transactions from all of the accounts linked to my banking login info. I have searched and searched for a filter to disclude those unwanted accounts, but no...

Use a cell value as part of a formula
Hi All, I'm trying to use a cell value as part of a vlookup function. The idea is to keep changing the lookup query based on a the contents of a specific cell This is the forumla I'm currently using VLOOKUP($A2,'C:\Matrix0203\07-Feb03\[025-MainPub-ET-1801.XLS]Sheet1'!$A$1:$M$200,2,FALSE) I need a way to replace "025-MainPub-ET-1801.XLS" in the formula based on another cell, where this will be generated (or manually entered). Right now I'm doing a select all, find and replace to achieve this. Any help will be appreciated... Chirag Hi Chirag, You could use ...

can't save files in subfolders using Word #2
I'm running Word on a Mac running OS X. When I go to save a file in Word, it only gives me the option to save in the root files like "Documents" or "Applications." How do I save the file into a subfolder? On a PC, I would double click to open the folders until I got to the folder I needed. That doesn't work here. Can someone help? I'm sure this is something obvious I'm missing. Thanks - Taylor In article <1163740041.258317.226140@b28g2000cwb.googlegroups.com>, taylorgriffin@gmail.com wrote: > I'm sure this is something obvious I'...

Deleting an email
I have an email (with a file attached) that is "hung up" in my outbox of Microsoft Outlook. Now I can't send or receive emails in Outlook. How can I delete the email that is "hung up"? Define hung up. Is it trying to send it? If so, disconnect your connection while it's trying to send and wait. It will time out after a bit and you should be able to delete it. Reconnect. "Aaron Hurliman" <AaronLHurliman@aol.com> wrote in message news:03b001c34f39$0fb61ff0$a301280a@phx.gbl... > I have an email (with a file attached) that is "hung up&q...