Results 1 to 3 of 3

Change font color of multiple objects at once with shorter code?

Threaded View

frankytheman Change font color of multiple... 01-19-2020, 10:01 PM
Logit Re: Need vba code: Change... 01-19-2020, 11:00 PM
bakerman2 Re: Need vba code: Change... 01-20-2020, 01:28 AM
  1. #1
    Registered User
    Join Date
    12-26-2019
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    69

    Change font color of multiple objects at once with shorter code?

    Hi everyone,
    I have this code below and I was wondering if there is a shorter code for that? It's just a snippet and the real userform has more than 50 Buttons.
    If I click the command button it will change the font color of all commandbuttons on the userform.

    Private Sub CommandButton1_Click()
    	CommandButton2.ForeColor = RGB(255,255,255)
    	CommandButton3.ForeColor = RGB(255,255,255)	
    	CommandButton4.ForeColor = RGB(255,255,255)
    	CommandButton5.ForeColor = RGB(255,255,255)
    	CommandButton6.ForeColor = RGB(255,255,255)
    	CommandButton7.ForeColor = RGB(255,255,255)
    	CommandButton8.ForeColor = RGB(255,255,255)
    	CommandButton9.ForeColor = RGB(255,255,255)
    	CommandButton10.ForeColor = RGB(255,255,255)
    End Sub
    Thank you.
    Last edited by Pepe Le Mokko; 01-20-2020 at 04:08 AM. Reason: Removed part of title. Please avoiid superfluous comments in titles

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Change the font and background color of the VBA code screen
    By niko79542 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-19-2022, 09:54 PM
  2. [SOLVED] VB code to change font color of cell with criteria
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-23-2018, 10:53 AM
  3. [SOLVED] Code to Change font color when land on sheet
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-13-2015, 12:06 PM
  4. [SOLVED] VB Code to change Font color
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2014, 07:10 PM
  5. [SOLVED] Trying to change verbose looping code into more efficient (and shorter) code please
    By dawatcher in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-03-2013, 07:43 AM
  6. Best way to change color of font in code?
    By bobbby1949 in forum Excel General
    Replies: 5
    Last Post: 08-27-2011, 04:50 PM

Tags for this Thread

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