+ Reply to Thread
Results 1 to 3 of 3

Selecting Shapes With Variable Based On Worksheet Data

  1. #1
    Registered User
    Join Date
    12-14-2011
    Location
    Edmonds, Washington
    MS-Off Ver
    Excel 2010
    Posts
    2

    Selecting Shapes With Variable Based On Worksheet Data

    I'm working on a macro that automatically highlights a map based on the data within my worksheet. There are 35 areas on my map each with their own shape that is named for the number of the map area (100, 110, 120 to 750, 760, 770).

    I need to be able to select the shape corresponding to the area so I can properly format it...

    Here's my code thus far:
    Please Login or Register  to view this content.
    However, this part doesn't work:
    "ActiveSheet.Shapes.Range(Array(Area)).Select"


    So I need to know how to properly specify a variable that I can use to select the shape so that I can assign it the right color.

    Any ideas?
    Last edited by svAndiamo; 12-15-2011 at 02:21 PM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Selecting Shapes With Variable Based On Worksheet Data

    Hello and welcome to the forum,

    Please take a few minutes to read the forum rules and add Code Tags around your vba code. Also where is your array I can't seem to find it in the code above.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    12-14-2011
    Location
    Edmonds, Washington
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Selecting Shapes With Variable Based On Worksheet Data

    Thanks for the reminder on code tags.

    Since I posted, I figured out that is was an array issue, and I was able to setup an array the worked for my needs. Below is the code that solved the issue:

    Please Login or Register  to view this content.

+ 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