+ Reply to Thread
Results 1 to 7 of 7

Change color of an image when clicked

  1. #1
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    118

    Change color of an image when clicked

    Hello, its seemed to me a very easy task when comes to change color's in VBA, but the following attachment just tested my patience.

    Does anyone know how can i change the color of a simple image and if i click on it the other 2 return to their default color.

    Regards.
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,379

    Re: Change color of an image when clicked

    There are at least three layers - the images are grouped -
    and each image is bordered by an oblong - to select them takes a right-click - I'm stumped - sorry
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    118

    Re: Change color of an image when clicked

    Quote Originally Posted by xladept View Post
    There are at least three layers - the images are grouped -
    and each image is bordered by an oblong - to select them takes a right-click - I'm stumped - sorry
    Well i think i didn't made myself clear.
    i know there are 3 layers, 2 of them are shape form, and the drawing in the middle is an imagem.

    The thing is that u can freely change colors and everything on shapes, but when i comes to images its kinda different.

    I tried to create a event that when i click on that image, that has a macro, it will change color and when i click in another one it will come back to the default color.

    That is easy on shapes, but i tried on that imagem and i cant make it work.

    I was wondering if someone has an answer for this.
    Last edited by Tpleme; 07-13-2017 at 06:26 PM.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,379

    Re: Change color of an image when clicked

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Not in this book?

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,379

    Re: Change color of an image when clicked

    See if this is any help:

    Please Login or Register  to view this content.
    N.B. You must select an Imagem before running the macro
    Last edited by xladept; 07-14-2017 at 11:04 AM. Reason: Details

  6. #6
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    118

    Re: Change color of an image when clicked

    Hi, thanks for your help.

    Since im still learning VBA its kinda hard to understand complex code (for me). I stared at this for hours still dont understand but with some, or a lot, search and frustration i finally for a solution for what i need and its a code that i truly understand how it works.


    I have 3 shapes and if i click in one of them its changes color and runs this simple code
    Please Login or Register  to view this content.
    the thing is that i wanted to click on other shape and the previous one change the color back . so i come up with this.

    For sure its a rookie code but it works and i did it myself :D
    Please Login or Register  to view this content.
    Thank you xladept for your patience :D

    Best regards

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,379

    Re: Change color of an image when clicked

    Good for you Tpleme - I was trying to get them all at once with a loop - but, I must say, my efforts were unrewarding

    You're welcome and thanks for the rep!

+ 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] Change colour of a cell when it's clicked, change when it's clicked again.
    By Crispy85 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-16-2014, 01:10 PM
  2. [SOLVED] Load web image when cell holding URL is clicked/double-clicked
    By jchamber00 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2013, 09:13 PM
  3. Placing image in cell, but selecting cell (not image) when clicked
    By rollingdice17 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2013, 11:15 PM
  4. [SOLVED] Run macro when Image is clicked
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-18-2013, 07:55 PM
  5. Excel saved as webpage - change links font color when clicked?
    By Elegidos in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 10-14-2009, 05:00 PM
  6. Macro for creating image border upon being clicked?
    By Cheshire in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-09-2009, 04:16 AM
  7. Change cell value when right-clicked/double-clicked
    By grime in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2005, 09:05 AM

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