+ Reply to Thread
Results 1 to 6 of 6

Select all shapes with similar names: Runtime error 1004

  1. #1
    Registered User
    Join Date
    03-22-2019
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    34

    Question Select all shapes with similar names: Runtime error 1004

    I am having trouble selecting only the shapes that contain a specific string within the name. The red line in the code is my problem.
    I am searching for all the shapes within the sheet, storing the names of the shapes I wan't in an array and placing the join output of the array into a string. I can't get past this point.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: Select all shapes with similar names: Runtime error 1004

    the following article may help you out

    https://stackoverflow.com/questions/...l-visual-basic

    also you don't need the chr(34) to select the shape
    and you are making 1 long string which you use to select a shape and that shape doesn't exist
    Last edited by Joske920; 11-07-2020 at 09:31 PM.
    Please be as complete as possible in your asking so it may save use all the time to rework the solution because you didn't give all the requirements. If you have a layout in mind please work it out first so we can adapt our solution to it. Thanks.
    If you have been helped, maybe you could click the *

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

    Re: Select all shapes with similar names: Runtime error 1004

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 11-07-2020 at 09:33 PM.
    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.

  4. #4
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: Select all shapes with similar names: Runtime error 1004

    @AlphaFrog

    does that not only go select all shapes 1 by 1 and not a group?

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

    Re: Select all shapes with similar names: Runtime error 1004

    The Replace:=False argument selects the group.

  6. #6
    Registered User
    Join Date
    03-22-2019
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    34

    Re: Select all shapes with similar names: Runtime error 1004

    Thank you. This worked.


    Quote Originally Posted by AlphaFrog View Post
    Please Login or Register  to view this content.
    Wow. This was super straight forward. Thanks, I learned something today!

+ 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] Runtime Error 1004 + Runtime 5
    By jrean042 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-07-2020, 08:16 AM
  2. [SOLVED] RunTIme Error 1004 when asked to select ".range"
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2018, 07:55 AM
  3. Error 1004: ActiveSheet.Shapes.AddChart.Select
    By andynewtovba in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-02-2015, 12:08 PM
  4. [SOLVED] ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'
    By bcn1988 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-07-2013, 11:30 AM
  5. Excel VBA Runtime error 1004 "Select method of Range class failed"
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-09-2012, 10:16 AM
  6. Error: Runtime 1004 - Select method of range class failed
    By additude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2008, 05:58 PM
  7. [SOLVED] Runtime Error 1004 Select method of Range class Failed
    By IanO in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2005, 04:05 PM

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