+ Reply to Thread
Results 1 to 12 of 12

Selecting the shape being info'ed and setting up a loop counter

  1. #1
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Talking Selecting the shape being info'ed and setting up a loop counter

    Hello!

    I am still banging around with this Shape Info macro, but I am stuck in a few places.

    1) I can't get the count "1 of 19", etc. to be on the same msgbox as the info box. I don't know how to set it up for when it runs through the Comment box portion of the macro. So for each shape, you have acknowledge two msgboxes instead of only one.

    So, the one msgbox example for each shape should look like:

    Analyzing: 1 of 19 Shapes
    Object Type:
    Name:
    Location:
    Visibility


    2) When it finds a shape, it should "Select" it, so that the user can see what the info is describing. I can't figure out the syntax for select.

    I attached the tester workbook full of shapes that I run the code on.

    I appreciate any help!

    VR/Lost

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by leaning; 03-23-2011 at 12:14 AM. Reason: Solved by Andy Pope!!

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Selecting the shape being info'ed and setting up a loop counter

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Selecting the shape being info'ed and setting up a loop counter

    Andy,

    That was a great idea to put the "Analyzing shape.." part in the msgbox header!

    I made a change in the msoFormControls section because the strheader was on the header and also as part of the text. (I just deleted the text part.)

    a) So the count works good until it gets to the comments. Then I noticed that you had to do a separate counter. Is there no way to continue the strheader count through the comment section? (so if there are 18 shapes, the user can see that every one (11 of 18, 12 of 18, etc.) is being info-ed)?

    b)if the shapes are being selected, it isn't real obvious. I can see the formula bar displaying different stuff as it works through the shapes, but when I watch the shapes themselves, there isn't that "select" box that jumps from shape to shape. (Like when you put your cursor in a cell, the cell borders get bolder.)

    Thanks for looking into this for me. You have come to my aid many times and I appreciate it.

    VR/Lost


    Please Login or Register  to view this content.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Selecting the shape being info'ed and setting up a loop counter

    You need to count the non comment object as well then and change the msgbox total count items in the comments section.

    Please Login or Register  to view this content.
    The items are selected, when visible, but the use of msgbox means the display is not updating to reflect this.

    You maybe better off moving this to a userform rather than msgboxes.
    That way you can display the shape names in a listbox and display relative information about and control as an when the user selects an item.

    This would also remove the problem of running the code on a sheet where there are possibly hundreds of shapes. I would not fancy clicking through all of that.

  5. #5
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Selecting the shape being info'ed and setting up a loop counter

    Andy,

    Thanks!

    18 shapes = 18 msgboxes and a count to 18! Outstanding!

    You maybe better off moving this to a userform rather than msgboxes.
    That way you can display the shape names in a listbox and display relative information about and control as an when the user selects an item.
    Yes, that would be better, but I can muddle my way through msgboxes. Setting up the userform with "Here are all your shapes. Click on a shape to get more information about it and highlight it" sounds perfect, but is leaps beyond my current knowledge level.

    The items are selected, when visible, but the use of msgbox means the display is not updating to reflect this.
    I don't understand this. I posted a question about this particular aspect of this project (selecting objects) to get more info. I can see the shape (a label), so it looks visible to me. When I use GoTo...objects, it selects it. But when the macro runs and puts up the info msgbox about that label, the label itself isn't selected (no drag markers) that I can see, so I have to look all over the sheet to see where "Label 12" is. I want to duplicate how GoTo..objects does the selecting, but on a individual level vice all objects at once.

    VR/Lost

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Selecting the shape being info'ed and setting up a loop counter

    If you step through your code line at a time you will see the items that can be selected are selected.

    It's when you run the code the updating of the selection is not displayed.

  7. #7
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Selecting the shape being info'ed and setting up a loop counter

    Andy,

    It's when you run the code the updating of the selection is not displayed.
    .

    Is there a way to do this?

    VR/Lost

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Selecting the shape being info'ed and setting up a loop counter

    Don't think so. It's why I suggested using a userform instead of msgboxes.

  9. #9
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Selecting the shape being info'ed and setting up a loop counter

    Andy,

    I dove into Listboxes on Userforms and came up with start.

    My thoughts: On the left side of the userform, put the listbox with the shape names.
    On the right side, have a button. When you select a shape from the listbox, and push the button, a msgbox (or maybe printing on the userform itself) would pop up showing info about the shape (type, address, visible, etc.) and then actually select (highlight) the shape on whatever sheet you are examining so that you can see where it is.

    I managed to populate a listbox with shape names..but can't figure out how to use that to get the shape info. ( I also can't figure out how to get anything to list in the 2nd column of the listbox. At one time, I was thinking Col 1: shape.name; Col 2: shape type, etc., but never could figure out the syntax to get column 2's stuff to show up.)

    Any help in making forward progress appreciated!

    Please Login or Register  to view this content.
    VR/Lost

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Selecting the shape being info'ed and setting up a loop counter

    Have a look at this example which lists the details of shapes via listboxes.

    There is a select button as well as double clicking shape in the list.

    Note that some shapes do not get the bounding handles displayed even when selected. You may have to consider some other way of drawing the users attention to these shapes.
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Selecting the shape being info'ed and setting up a loop counter

    Andy,

    Excellent! You created something which summed up this thread nicely. You even included all the info I was asking to see for each shape, plus the ability to select them on the sheets themselves.

    I definitely appreciate what you did.

    Thank you!

    VR/Lost

  12. #12
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Talking Re: Selecting the shape being info'ed and setting up a loop counter

    Andy,

    If you get a second, open this XL Checker workbook and run the Shape Info button on another worksheet that has some shapes on it.

    I took what you provided and ran with it so it displays more properties (more than you will ever need, probably) for each shape.

    The Select feature that you did is still the coolest part.

    Thanks again!

    VR/Lost
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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