Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running macros from formula bar
I have a macro that changes the color in certain cells based on the result in
a particular cell. My question is this: can I have it run automatically based on any new value in that cell or am I forced to run it with a toolbar. I would prefer that it be done automatically. The basics are these: I have an excel workbook that contains information about items for sale from suppliers. One formula computes my minimum profit margin and displays both the $ amount and the % amount. Another formula computes the maximum percentage. I have done a macro that changes the backgound color of certain cells based on the % obtained. Changes cells to red if below 0%. I did a macro because I could not figure out how to do this with a formula. The macro is as follows (the commented out portions do not work at present, but the rest does): Public Sub ChangeColor() ' Worksheets("Orders").Range("D18").Select ' With Selection ' MAXPPA = "MAXPMA / SMSRP" If Worksheets("Orders").Range("D18").Value < 0 Then Worksheets("Orders").Range("C17:C18").Interior.Col orIndex = 3 Else Worksheets("Orders").Range("C17:C18").Interior.Col orIndex = 0 End If ' End With End Sub I would like this to run automatically based on the value in cell D18, rather than having it run from a button. Thanks, /s/ Gene |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Running Macros | Excel Discussion (Misc queries) | |||
HELP - Running Macros in VBA | New Users to Excel | |||
Running Macros | Setting up and Configuration of Excel | |||
Running Macros | Excel Programming | |||
HELP: Running two Macros, one before the other | Excel Programming |