+ Reply to Thread
Results 1 to 3 of 3

Changing colors of shapes based on a click (VBA)

  1. #1
    Registered User
    Join Date
    07-24-2014
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    2

    Changing colors of shapes based on a click (VBA)

    Hi,

    I am trying to make a code that changes the color of a shape when I click that shape.

    Ex. I have a blue oval and when I click it, it changes to pink. When I click it again, it changes to black. When I click it another time, it will change to orange. When I click it one last time, it goes back to blue and cycles through all of the colors as I keep clicking it.

    Currently this is what I have:

    Please Login or Register  to view this content.

    This code works for one shape (named Oval 16). The problem is I want to apply it to around 600+ shapes (all ovals). I am very new to VBA so I am completely lost. The last thing I want to do is go through and give each oval it's own code (that would be like 10,000 lines!). Frankly, I am surprised I figured out the original code.

    Does anyone have any suggestions?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Changing colors of shapes based on a click (VBA)

    Hi domexcel and welcome to ExcelForum,

    Thank you very much for using CODE TAGS.

    Try the following macro:
    Please Login or Register  to view this content.
    Lewis

  3. #3
    Registered User
    Join Date
    07-24-2014
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    2

    Re: Changing colors of shapes based on a click (VBA)

    Phenomenal! Thank you so much, I really appreciate it.

+ 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] Changing fill color of shapes based on changing cell value
    By Stefan1983 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2012, 10:33 AM
  2. Changing labels' colors for click event
    By frankienap in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-06-2012, 03:24 PM
  3. Efficient way to animate changing colors for a large number of shapes?
    By nannerdw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2011, 08:08 AM
  4. Changing Colors of Shapes
    By seckin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2011, 03:23 PM
  5. Colors of shapes and cells
    By mike cook in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-01-2008, 10:59 AM

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