+ Reply to Thread
Results 1 to 6 of 6

map shape HELP!

  1. #1
    Registered User
    Join Date
    03-27-2017
    Location
    No
    MS-Off Ver
    Yes
    Posts
    30

    map shape HELP!

    I have created a map with 20 shapes for 20 states.

    I want to be able to select the shape, and have it change color. Also, I would like cell A5 tell me the name of the shape. (active shape?)

    A problem im encountering is that I have labels on top of the shapes, so when I select the shape, im actually selecting the label.

    Can this be done?

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: map shape HELP!

    Will this work for you?

    Do the labels need to be on top of each shape? Put label below each shape and then use colour fill with transparency on the shape to allow label to be visible.

    Click on the shape and run this macro to change its fill colour

    Please Login or Register  to view this content.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Registered User
    Join Date
    03-27-2017
    Location
    No
    MS-Off Ver
    Yes
    Posts
    30

    Re: map shape HELP!

    Quote Originally Posted by kev_ View Post
    Will this work for you?

    Do the labels need to be on top of each shape? Put label below each shape and then use colour fill with transparency on the shape to allow label to be visible.

    Click on the shape and run this macro to change its fill colour

    Please Login or Register  to view this content.
    Thanks for the quick response! But how do I implement this code?

    And yes, the labels need to be on top of the shape, ive made the map so it fits on the view area of the sheet, and they are tiny, and it needs those labels.

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: map shape HELP!

    If that will not work,

    another option:
    - 1. select the label and use shortcut to run a macro to "send the label to the back"
    Please Login or Register  to view this content.
    - 2. select the shape and use shortcut to run a macro to change its colour
    Please Login or Register  to view this content.
    - 3. send the shape to the back (where it started)
    Please Login or Register  to view this content.
    To return the name of the active shape in cell A5:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-27-2017
    Location
    No
    MS-Off Ver
    Yes
    Posts
    30

    Re: map shape HELP!

    [QUOTE=kev_;4620892]If that will not work,

    another option:
    - 1. select the label and use shortcut to run a macro to "send the label to the back"
    Please Login or Register  to view this content.
    - 2. select the shape and use shortcut to run a macro to change its colour
    Please Login or Register  to view this content.
    - 3. send the shape to the back (where it started)
    Please Login or Register  to view this content.
    To return the name of the active shape in cell A5:
    Please Login or Register  to view this content.
    [/QUOTE

    How would the entire code look like? I'm still new to macros.

    I select the shape, right click and I don't see something like "Edit Code".

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: map shape HELP!

    You do not need to quote everything back - it just fills the thread with clutter.
    Use quotes if you are referring back to something much further up the thread or to something where it isn't obvious what you are referring to without using the quotes.

    Have a play with the attached workbook which contains 3 macros.
    There are 2 shapes one on top of the other in the top left corner - a text box and a filled rectangle
    The shortcut are detailed in each macro
    Select a shape and then try {CTRL} t or {CTRL} {SHIFT} t or {CTRL} k
    Find the VBA area with {ALT} {F11}

    Then, please attach your workbook - with only 2 or 3 shapes plus their labels (avoid the file being too big) and I will look at it for you
    (click on Reply/ Go Advanced/look below for Manage Attachments etc

    ManageAttachments3.jpg

    VBA:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kev_; 04-04-2017 at 12:19 AM. Reason: Removed unnecessary lines of code

+ 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. Shape buttons - Switch background image of shape on click and exit - referenced jpg
    By ApatheticAndrew in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-14-2015, 08:06 AM
  2. Assign macro with parameter to shape based on shape location
    By bobo3127 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2014, 11:18 AM
  3. [SOLVED] How to add 3d bevel (Cool Slant) shape effect to Oval shape
    By Steve@Rugby in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2013, 11:29 AM
  4. Replies: 13
    Last Post: 12-10-2013, 12:51 PM
  5. [SOLVED] Use a button to control a macro that inserts an image into a shape or resets the shape
    By nwb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2013, 04:41 PM
  6. Add command button to shape and change shape color on mouseover
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2012, 05:12 PM
  7. Replies: 0
    Last Post: 11-30-2012, 01:29 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