+ Reply to Thread
Results 1 to 3 of 3

How do I program in VBA, the background color of a Form Control Button?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-02-2013
    Location
    Indiana
    MS-Off Ver
    Microsoft 365 (Subscription)
    Posts
    192

    How do I program in VBA, the background color of a Form Control Button?

    I have a Button labeled "Proportioning Alarm", when I click this button, I would like to change the gray background color of the button to green, for an indication that the alarm procedure is running. I also have a button labeled "Stop Prop. Alarm", when I click this button, I would like to change the green "Proportioning Alarm", back to its default color of gray.

    "Proportioning Alarm" button runs the subrotine Proportioning_Alarm()

    "Stop Prop. Alarm" button runs the subrotine Stop_Proportioning_Alarm()

    I would like to add the VBA code to change the button to green in the subrotine Proportioning_Alarm() at the beginning of the subrotine under initialization section. That way the first time the button is clicked it will turn green and stay green until the "Stop Prop. Alarm" button is pressed or the alarm series has finished. In order to change the "Proportioning Alarm" button back to its default color of gray I would like to add that VBA code to the Stop_Proportioning_Alarm().

    I have attached my worksheet and sub-routines and modules.

    Thank you so much for your response!

    redsab
    Attached Files Attached Files

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How do I program in VBA, the background color of a Form Control Button?

    you can't change the color of a forms button-you would need to use an activex control or a shape instead
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor
    Join Date
    05-02-2013
    Location
    Indiana
    MS-Off Ver
    Microsoft 365 (Subscription)
    Posts
    192

    Re: How do I program in VBA, the background color of a Form Control Button?

    JosephP, in lieu of your information, I have choosen to just make the letters green instead of the background. I have made my coding alterations and everything works fine. Thanks for your expertise!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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