+ Reply to Thread
Results 1 to 6 of 6

need a macro to select all shapes with somewhat similar names in all sheets of a workbook

  1. #1
    Registered User
    Join Date
    09-14-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    38

    need a macro to select all shapes with somewhat similar names in all sheets of a workbook

    Hi,

    I am having a simple macro which select the a specific named shape and make it not printable when I print the sheet. It looks like as under:
    Please Login or Register  to view this content.
    Now, this sheet is having other shape also with the name as "small2" (in same sheet)
    Then Sheet (2) will have shape as "small3", "small4"
    Then Sheet (3) will have shape names as "small5", "small"6, "small7"
    Total 6 sheets are there. and total shapes will be approx. 12

    I want a macro to select all the shapes with the names like "smal*" Then select all of them one by one and make those non-printable.

    Please guide me
    Last edited by vatsalgos; 03-21-2024 at 10:01 AM. Reason: proper phrasing

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: need a macro to select all shapes with somewhat similar names in all sheets of a workb

    Your sample code doesn't need all that indirection. You can refer directly to Shapes("small1"). Also based on your description, you want to use False instead of True.
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    09-14-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    38

    Re: need a macro to select all shapes with somewhat similar names in all sheets of a workb

    yes
    Sorry it is PrintObject = False
    It was mistake on my part

    But this macro is true for first sheet only
    I want to go this macro to all the sheets one by one

  4. #4
    Registered User
    Join Date
    09-14-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    38

    Re: need a macro to select all shapes with somewhat similar names in all sheets of a workb

    I want something like his, but it is not working :


    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-14-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    38

    Re: need a macro to select all shapes with somewhat similar names in all sheets of a workb

    It's done as under:

    Please Login or Register  to view this content.
    Last edited by vatsalgos; 03-22-2024 at 12:55 AM. Reason: Adding tags around code

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: need a macro to select all shapes with somewhat similar names in all sheets of a workb

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however we recommend that you include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Guideline #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here.

+ 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. [SOLVED] Select all shapes with similar names: Runtime error 1004
    By mrbarba in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-07-2020, 09:53 PM
  2. [SOLVED] How can I select all shapes using their names and aligh them?
    By icyrius in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-22-2017, 01:02 PM
  3. [SOLVED] copy sheets to new workbook when sheet names are similar.
    By kleptilian in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2016, 09:19 AM
  4. [SOLVED] Macro to check if folder contains excel files with names similar to This Workbook
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-17-2013, 07:54 PM
  5. [SOLVED] Select All Sheets With Names Beginning With Specified Value In Macro
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2012, 03:48 PM
  6. Macro to select all shapes (text boxes) in workbook
    By Humahuaca in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-28-2012, 04:21 AM
  7. Macro to select all shapes (text boxes) in workbook
    By Humahuaca in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2012, 12:27 PM

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