+ Reply to Thread
Results 1 to 2 of 2

Nested Code to remove shapes (buttons)

  1. #1
    Registered User
    Join Date
    06-04-2014
    Posts
    24

    Nested Code to remove shapes (buttons)

    I am reusing the same "Template" to replicate various forms.

    I have written a routine that clears the worksheet, and prepares it for the next "template".

    Most of the buttons used are standardized macros and remain on the "cleared template" just fine however, I needed to create a button on each form that would "reload the current form" of which, has it's own "Reload Form" button copied over from the template.

    For starters the shapes are named "Rounded Rectangle 1", "Rounded Rectangle 2", "Rounded Rectangle 3", etc. as I have not figured a method of changing their names (which really isn't important) what is important I need to nest a series of these in my standard "ClearForm" macro which will skip to the next "Shape" if the previous is not located on the current worksheet. IF / Elseif / Endif


    Please Login or Register  to view this content.
    Does that make sense? It is getting late, in other words I don't want to have to create a new macro for every "Template" I need cleared so the worksheet is ready for the next template or, if necessary to reload the existing sheet. Which in fact is what the "Shape" does, and I need cleared when the time is right, and the work has been completed on the sheet.

    If anyone happens to know how to "Label" these shapes please let me know however, as stated that is not what is important at this time

    Thanks....

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Nested Code to remove shapes (buttons)

    Do you want to clear all shapes with a name that begins with "Rounded Rectangle"? If yes, try this...

    Please Login or Register  to view this content.
    If you want to manually change the name of a shape, first select the shape and change its name in the Name Box just to the left of the formula bar. Remember to press the Enter key after typing. Otherwise the change doesn't take.
    Last edited by AlphaFrog; 07-01-2018 at 06:05 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Create shapes with formatting using macro buttons
    By daveb86 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-21-2017, 09:38 PM
  2. [SOLVED] VBA Solution to Copying Command Buttons and Shapes
    By DarkF1ame in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-16-2016, 06:49 PM
  3. [SOLVED] Delete Buttons made from shapes when copying sheet to new workbook
    By Bflare in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-27-2014, 09:44 AM
  4. Unable to Hide/Unhide Shapes and Buttons with VBA: Error 400
    By mp4-4 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-21-2013, 03:58 PM
  5. Can I Hide Shapes That Are Buttons???
    By JonesZoid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2012, 05:32 PM
  6. [SOLVED] Want to just Delete Command Buttons frm a Copied Sheet excluding ALL other Shapes ?
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2012, 03:00 AM
  7. Formatting buttons & drawing shapes.
    By nomadscot in forum Excel General
    Replies: 4
    Last Post: 07-15-2006, 11:52 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1