+ Reply to Thread
Results 1 to 8 of 8

Change the background color of a Macro button

  1. #1
    Registered User
    Join Date
    01-20-2021
    Location
    Las Vegas, NV
    MS-Off Ver
    Windows 10
    Posts
    35

    Change the background color of a Macro button

    Hi all. Is it possible to add code to this..

    Sub CopyPasteBuildingServices()

    '

    '
    Range("V4").Select
    Selection.Copy
    Range("V6:V428").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    End Sub

    that would change the macro button background color from the default grey, to a different color? The Macro button is currently located in cell V5.

    I'd appreciate any assistance!

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Change the background color of a Macro button

    Yes and No.

    First No you cannot change the colour of a Macro button.

    However you can replace the Macro button with a shape from the Drawing tab.

    You can change the colour of that at will.


    Please Login or Register  to view this content.
    Last edited by mehmetcik; 05-28-2021 at 04:11 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    03-10-2021
    Location
    Paryzevo
    MS-Off Ver
    2k3
    Posts
    60

    Re: Change the background color of a Macro button

    An activex button can be created, then the background color can be changed:
    Please Login or Register  to view this content.
    Last edited by a2b1c1d1e1f1; 05-28-2021 at 04:00 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Change the background color of a Macro button

    If you use an ActiveX button you can
    I do it in a few of our reports so that the user knows the process has completed, i change the color to green when done.

    Attachment 734561

    using something like this
    ActiveSheet.CommandButton1.BackColor = RGB(120, 105, 2)

    depending on what your button name is.
    If you find the suggestion or solution helpful, please consider adding reputation to the post.

  5. #5
    Registered User
    Join Date
    01-20-2021
    Location
    Las Vegas, NV
    MS-Off Ver
    Windows 10
    Posts
    35

    Re: Change the background color of a Macro button

    mehmetcik .Thank you for your reply. Do I add the code you suggested to my existing code?

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,700

    Re: Change the background color of a Macro button

    You should change your code also.
    For values only, change the code in your first post to
    Please Login or Register  to view this content.
    and for copying everything, incl formatting, possible formulae and whatever, change to
    Please Login or Register  to view this content.
    Minimize selecting as much as possible. It is seldom required.

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Change the background color of a Macro button

    Create a shape. Rectangle, circle, hexagon whatever.

    Start your macro recorder.

    Record yourself clicking on the shape and changing its colour to red then white then blue.

    Right click on your shape and use assign macro to point to your recorded macro.

    Now edit your macro to change the macro to each color in turn.

    That should teach you enough to get you started.

  8. #8
    Registered User
    Join Date
    01-20-2021
    Location
    Las Vegas, NV
    MS-Off Ver
    Windows 10
    Posts
    35

    Re: Change the background color of a Macro button

    Thank you mehmetcik, your suggestion solved my issue. I 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. Replies: 8
    Last Post: 04-02-2016, 04:00 AM
  2. [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
  3. Change cell background color based on another cells background color
    By Queo in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 06-10-2014, 05:28 AM
  4. Macro that includes a background color change
    By dktraina in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-26-2013, 11:26 AM
  5. [SOLVED] Macro to change all cells with a certain background color in another background color
    By kevinvzandvoort in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2012, 11:04 AM
  6. [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
  7. macro to change cell background color
    By rocket0612 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-21-2005, 09:46 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