Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Command Button Color
Suppose I have a spreadsheet that does a number of calculations. I hav a command button which I use to execute the solutions. 1. I would like the button to turn green (or some color) when th solution has converged, which I can check at any time 2. If a change to any parameter is made (and thus the former solutio is not a solution for the new case) I would like to change the color to red for example. i would appreciate it if someone could help me figure out how t accomplish this, particularly the second part. Thank yo -- justbrewi ----------------------------------------------------------------------- justbrewit's Profile: http://www.excelforum.com/member.php...fo&userid=3753 View this thread: http://www.excelforum.com/showthread.php?threadid=57179 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Command Button Color
if the solution is arrived at through iterative calculations in a single
calculation event, then you can not take actions inside that event. If you code performs the calculations, then just add code to color the button based on the conditions within your code. -- Regards, Tom Ogilvy "justbrewit" wrote: Suppose I have a spreadsheet that does a number of calculations. I have a command button which I use to execute the solutions. 1. I would like the button to turn green (or some color) when the solution has converged, which I can check at any time 2. If a change to any parameter is made (and thus the former solution is not a solution for the new case) I would like to change the color, to red for example. i would appreciate it if someone could help me figure out how to accomplish this, particularly the second part. Thank you -- justbrewit ------------------------------------------------------------------------ justbrewit's Profile: http://www.excelforum.com/member.php...o&userid=37539 View this thread: http://www.excelforum.com/showthread...hreadid=571792 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Command Button Color
This is fairly straight forward if you use VBE and a User Defined Form. Is that the case or are you using the buttons from the worksheet tool? -- raypayette ------------------------------------------------------------------------ raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569 View this thread: http://www.excelforum.com/showthread...hreadid=571792 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Command Button Color
Option Explicit
Private Sub CommandButton1_Click() 'your code to do all the work here if somethinggoodhappened = true then Me.CommandButton1.BackColor = &HFF00& else me.commandbutton1.backcolor = &HFF& end if End Sub justbrewit wrote: Suppose I have a spreadsheet that does a number of calculations. I have a command button which I use to execute the solutions. 1. I would like the button to turn green (or some color) when the solution has converged, which I can check at any time 2. If a change to any parameter is made (and thus the former solution is not a solution for the new case) I would like to change the color, to red for example. i would appreciate it if someone could help me figure out how to accomplish this, particularly the second part. Thank you -- justbrewit ------------------------------------------------------------------------ justbrewit's Profile: http://www.excelforum.com/member.php...o&userid=37539 View this thread: http://www.excelforum.com/showthread...hreadid=571792 -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Command Button Color
Thanks for the help, but I am not sure that I am being totally clear. After I run the VB code and find a solution to my equations, can I (somehow) change the button color if any cell in the workbook is modified by the user? -- justbrewit ------------------------------------------------------------------------ justbrewit's Profile: http://www.excelforum.com/member.php...o&userid=37539 View this thread: http://www.excelforum.com/showthread...hreadid=571792 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Command Button Color
If any cell is changed in the workbook????
This code goes behind the ThisWorkbook module: Option Explicit Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Me.Worksheets("sheet2").OLEObjects("commandbutton1 ").Object.BackColor _ = &HFF& End Sub Change the sheet name and the commandbutton name to match. justbrewit wrote: Thanks for the help, but I am not sure that I am being totally clear. After I run the VB code and find a solution to my equations, can I (somehow) change the button color if any cell in the workbook is modified by the user? -- justbrewit ------------------------------------------------------------------------ justbrewit's Profile: http://www.excelforum.com/member.php...o&userid=37539 View this thread: http://www.excelforum.com/showthread...hreadid=571792 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
change the face color of an Excel command button | Excel Discussion (Misc queries) | |||
Change color of command button | Excel Discussion (Misc queries) | |||
VB's Command Button vs Form's Command Button | Excel Programming | |||
Command Button Color For Next Loop | Excel Programming | |||
command button color | Excel Programming |