+ 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
    MS 365
    Posts
    13,475

    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
    Office 365
    Posts
    1,483

    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
    MS 365
    Posts
    13,475

    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)

Similar Threads

  1. [SOLVED] can i change vba code with press of a command button?
    By kevinu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-01-2017, 04:14 PM
  2. On button press, if the currently selected cell is this, do that otherwise do the other
    By excel12121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2015, 02:02 PM
  3. [SOLVED] macro that sets background fill color on inserted data from button press
    By the block in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-29-2014, 03:25 PM
  4. [SOLVED] Move contents of cells from one cell to another at the press of a button......
    By davidmstorey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2014, 04:14 AM
  5. [SOLVED] Change Background color of a Form Button or ActiveX Button
    By Aeneren in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-11-2012, 12:19 PM
  6. Show A1 in C3, then A2 in C3, then A3 in C3 until blank cell reached on button press
    By jamiepullen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2008, 06:04 PM
  7. How can I delete 1 from the value of a cell when I press a Button.
    By Gary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2005, 04:06 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