Results 1 to 5 of 5

UserForm with three CheckBoxes for a color test.

Threaded View

  1. #1
    Registered User
    Join Date
    03-29-2015
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    2

    UserForm with three CheckBoxes for a color test.

    Hello,
    I make a little userform for a colortest.
    It work with a Commandbutton (controle).
    Is there any possibility to work without that button?

    Thanks in advance,

    NonkeLuc.

    Private Sub Controle_Click()
    
     If CheckBox1.Value = True And CheckBox2.Value = True And CheckBox3.Value = True Then
     UserForm1.TextBox1.BackColor = RGB(165, 42, 42) ' brown
     ElseIf CheckBox1.Value = True And CheckBox2.Value = True Then
     UserForm1.TextBox1.BackColor = RGB(255, 128, 0) ' orange
     ElseIf CheckBox1.Value = True And CheckBox3.Value = True Then
     UserForm1.TextBox1.BackColor = RGB(238, 130, 238) ' violet
     ElseIf CheckBox2.Value = True And CheckBox3.Value = True Then
     UserForm1.TextBox1.BackColor = RGB(0, 128, 0) ' green
     ElseIf CheckBox1.Value = True Then
     UserForm1.TextBox1.BackColor = RGB(255, 0, 0) ' red
     ElseIf CheckBox2.Value = True Then
     UserForm1.TextBox1.BackColor = RGB(255, 255, 0) ' yellow
     ElseIf CheckBox3.Value = True Then
     UserForm1.TextBox1.BackColor = RGB(0, 0, 255) ' blue
     Else: UserForm1.TextBox1.BackColor = RGB(255, 255, 255) ' white
     End If
     End Sub
    Last edited by NonkeLuc; 05-24-2015 at 08:28 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Userform: Warn user if all checkboxes on a userform are unticked.
    By MrMiyagi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2014, 12:08 AM
  2. Print Sheets based on checkboxes in UserForm, Checkboxes also control another macro
    By krackaberr in forum Excel Programming / VBA / Macros
    Replies: 34
    Last Post: 03-05-2013, 11:12 AM
  3. Checkboxes in Userform
    By ABSTRAKTUS in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2010, 04:13 PM
  4. refer to multiple specific checkboxes to test properties
    By kazlady in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2009, 04:16 AM
  5. Userform Checkboxes
    By gti_jobert in forum Excel General
    Replies: 1
    Last Post: 01-27-2006, 09:25 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