Results 1 to 9 of 9

change command button colour when selected

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    change command button colour when selected

    Good Morning

    I have several forms with multiple command buttons... all have different names however they all start with 'cmd'

    Is there a way for a button to change colour when selected whilst changing the rest of the buttons on that form to their origional colour... I know how to do it, using this, when the buttons have numbers instead of names....

    Many thanks for your help

    Jim
    For x = 1 To 18
            Me.Controls("cmd" & x).BackColor = &HFFFFFF 'sorts the main cmd button backcolours, light grey
            cmd1.BackColor = RGB(51, 204, 255) 'selected button turns blue
        Next
    Attached Files Attached Files
    Last edited by JamesT1; 10-02-2023 at 07:50 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 08-31-2017, 12:16 PM
  2. need a command button to change / unchange the colour of specified cells
    By fingermouse in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-09-2014, 09:36 AM
  3. [SOLVED] Command button grayed out till option button selected
    By Jeff121 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2013, 11:00 AM
  4. using a command button to change certain cells font colour.
    By ncaravela in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-17-2013, 10:08 AM
  5. [SOLVED] Change Command Button Colour Based on Cell
    By adam.hewitt5 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-08-2012, 09:43 AM
  6. Colour change of the "Command Button"
    By Johann 12081 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-21-2009, 01:24 PM
  7. command button that changes colour of selected cells
    By BLRITCHIE in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2008, 07:33 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