+ Reply to Thread
Results 1 to 6 of 6

How can I select all shapes using their names and aligh them?

  1. #1
    Forum Contributor
    Join Date
    06-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    150

    How can I select all shapes using their names and aligh them?

    I am having some difficulty grabbing a group of shapes to later align them and group them.

    Here are some of the approaches taken.
    1. A loop adds shape names to array. Then later I want to select them for alignment using this line...
    HTML Code: 
    This did not work.
    2. Add shape names to array and comma delimit them for selection
    HTML Code: 
    This also did not work.

    The recorded macro that did the trick I need looks like this,

    HTML Code: 
    I want to achieve the same results using a programmable array range.

    Any help is greatly appreciated. I have been fighting with this for two days. Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    422

    Re: How can I select all shapes using their names and aligh them?

    When you say 'grabbing', do you mean you want to select the shapes with the mouse and then have VBA do something to the group you selected? Or will everything be in the macro?

    Are the shapes drawn manually, or in VBA?

  3. #3
    Forum Contributor
    Join Date
    06-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    150

    Re: How can I select all shapes using their names and aligh them?

    I want to select the shapes with the mouse and then have VBA do something to the group you selected with a macro.

    All shapes drawn using VBA

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: How can I select all shapes using their names and aligh them?

    Perhaps

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    422

    Re: How can I select all shapes using their names and aligh them?

    The code you show works fine, but as you've already selected what you want, leave the first line out. I've added a check that something relevant is selected first to prevent error messages if no shapes are selected.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    150

    Re: How can I select all shapes using their names and aligh them?

    Thanks for the help. I made it work using your inputs.
    Last edited by icyrius; 03-22-2017 at 03:22 PM.

+ 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. product codes to aligh with numbers
    By steve111 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-01-2014, 02:17 AM
  2. [SOLVED] Names of all Visible Shapes
    By Jonathan78 in forum Excel General
    Replies: 3
    Last Post: 02-21-2014, 03:37 PM
  3. select ALL Shapes
    By chibouki in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-23-2012, 01:13 PM
  4. Copy And Paste Shapes according to the names written on them
    By macrogeek in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-20-2011, 04:44 AM
  5. [SOLVED] Select multiple Shapes
    By CLR in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-22-2011, 09:32 AM
  6. Simple names for shapes
    By Gordon@work in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-06-2007, 01:39 AM
  7. Select shapes?
    By Dr.Ile in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2007, 09:27 PM
  8. [SOLVED] Names of Grouped Shapes
    By Mogwai in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-07-2005, 03: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