+ Reply to Thread
Results 1 to 22 of 22

How to make 'button' change colour when hover over them

  1. #1
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Red face How to make 'button' change colour when hover over them

    I have seen some worksheets where when you hover over a 'button' (with a hyperlink in) the button changes colour or the shadow effect changes.

    Does anyone know how this can be done?


    Kind regards

  2. #2
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    Re: How to make 'button' change colour when hover over them

    Please Login or Register  to view this content.
    put this into a userform with a button in it

    you can make it fun too:
    Please Login or Register  to view this content.
    Last edited by Leon V (AW); 08-14-2013 at 06:02 AM.

  3. #3
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    Hi thanks for the reply. I am running Excel 2003 and am quite a novice. How do I get this to work in by workbook?

  4. #4
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    Re: How to make 'button' change colour when hover over them

    oh sorry thought it was a userform button

    is this an activeX or form controls button?

  5. #5
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    Just an auto shape sorry i can change to control button

  6. #6
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    Re: How to make 'button' change colour when hover over them

    http://www.ozgrid.com/forum/showthread.php?t=62478

    see attached
    Attached Files Attached Files
    Last edited by Leon V (AW); 08-14-2013 at 09:56 AM. Reason: put up example

  7. #7
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    Thank you but I cannot view the file as am at work behind a secure internet server (cannot download or view certain files) sorry. Thanks all the same though

  8. #8
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    Re: How to make 'button' change colour when hover over them

    Can you insert ActiveX Controls?

    If you can Place an activeX image that is 20 pixels larger every side than your active x buton behind your active x button, make the image background and outline transparent then group the image and button.

    place this code in the sheet object code (eddit as you see fit):
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    I am sorry to say I do not know what an active X is in excel as I am a novice. I am not sure my work PCs will allow me to use active X.

  10. #10
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330
    Last edited by Leon V (AW); 08-15-2013 at 12:17 PM.

  11. #11
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    Thank you for this

  12. #12
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    Ok I am going to sound very dumb here now.
    Active x buttons making them 20pixels bigger all round (how do I do this)
    The codes I never know where to put them in Excel.

    I am very limited in my Excel exerience and have only discovered macros within the last month and that was only by chance.

    I know excel can make the buttons I want change colour when hovered over by mouse pointer. I just have no clue at all in how to get this to work.

    Ideally I need step by step instructions, I am limited in what can do in terms of downloads and websites due to the secure nature of my works PC.

    Any help from you guys is very much appreciated but I need help on how to do these suggestions sorry.

  13. #13
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    Ok have worked out what active x is and I have been looking at the properties of the active x shape. is this where I change the pixel size?

  14. #14
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    Re: How to make 'button' change colour when hover over them

    Ok not a problem
    steps:

    1) start a new workbook and place an active x button and an active x image on sheet 1
    2) right click and select "view code" on each of them [this should open up the VBA editor]
    3) paste the code suplied earlier into the open VBA code sheet
    4) in the VBA look at the object properties window [press F4 to open this]
    5) in the properties window you will see the values for hight and width for each object [use the dropdown list to swap between button and image]
    6) set the hight and width as required the image must be larger than the button
    7) back in excel right click the active x image and send to back then place the button over them middle of the image and group them
    8) check it all works and set the colours you wish the button to be in VBA [you may need to turn off design mode in VBA toolbar]
    9) set the image background and border to transparent/None
    Last edited by Leon V (AW); 08-19-2013 at 06:47 AM.

  15. #15
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    Thank you very much for this Leon V. I have followed your steps (very helpful) but for some reason my excel is not having any of it. It could be down to my excel may have reduced functionality through work.

    Thaqnk you for your help though.

  16. #16
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    Re: How to make 'button' change colour when hover over them

    where is your excel falling over? [some steps could just require longer winded methods of exicution in excel 98-03]

  17. #17
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    I do not know where it is that it is failing sorry. I can get the active X image and button and size it all but once I put the code in nothing happens.

  18. #18
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    Re: How to make 'button' change colour when hover over them

    Without seeing what you are doing I can't really help my guess would be that the code is not linked to the active x controls because the names are different or you are pasting it in the wrong place.

    when you right click and view code try using the dropdown on top right of VBA to select mousemove.
    also make sure design mode is off. active x controls are inactive when design mode is on.

  19. #19
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    thank you for this.

  20. #20
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    Right I have got this working 'with fiddling I don't know how'.

    But thank you very much.

    I have a button set to change colour on mouse over then when you click a message appears. the last thing i want is for this button to take me to a link. The hyperlink option is not working.

  21. #21
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    Re: How to make 'button' change colour when hover over them

    Please Login or Register  to view this content.
    change "CommandButton1" to whatever you named your button. The name is not necesarilly the text it displays (this is the caption) it is the title it was when you select it in the VBA editor properties dropdown.

  22. #22
    Registered User
    Join Date
    05-02-2013
    Location
    wales
    MS-Off Ver
    Excel 2002
    Posts
    31

    Re: How to make 'button' change colour when hover over them

    Right I have to say a big thank you on this. I have now got my buttons labelled positioned and sized changing colour upon hovering to my desired colour, they link to either another worksheet or an internet site.

    many thanks for this.


+ 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. How to make row change colour based on text colour in row?
    By Joanna13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2010, 04:39 PM
  2. Hover over button and change it's colour
    By gpcool in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-15-2008, 05:37 PM
  3. [SOLVED] How do I make it change colour
    By raven_guy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  4. [SOLVED] How do I make it change colour
    By raven_guy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  5. [SOLVED] How do I make it change colour
    By raven_guy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-05-2005, 10:05 PM

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