+ Reply to Thread
Results 1 to 5 of 5

Press button to change cell background

  1. #1
    Registered User
    Join Date
    01-21-2020
    Location
    UK
    MS-Off Ver
    2010
    Posts
    2

    Press button to change cell background

    Hi all, I don't know if this is possible or not, but if it is I could really do with some pointers on how I can get this to work

    The idea is that if a user presses the blue button the background in the coloured cells changes to blue, if red button pressed then the fill colour changes to red

    Have attached picture to show a brief screenshot

    Capture.JPG

    Any advice on the best way to achieve this (if possible) is much appreciated, or alternatively let me know if it is not possible.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    XL 2010,2016
    Posts
    12,188

    Re: Press button to change cell background

    You can use the macro recorder to turn the cells red, then use it again to turn the cells blue.
    Assign the appropriate macro to each of the buttons.

  3. #3
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    1,335

    Re: Press button to change cell background

    Some pointers

    by using "Selection" you can tell Excel VBA to use the selected cells for the next command
    with the RGB function you can set any color you need.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-21-2020
    Location
    UK
    MS-Off Ver
    2010
    Posts
    2

    Re: Press button to change cell background

    So it is possible ? that is excellent news, thanks very much.

    Guess I have best start reading up on macros, I never needed/used them before !


  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    XL 2010,2016
    Posts
    12,188

    Re: Press button to change cell background

    Here is a simple clip on recording a macro

    Record a macro

+ 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