Conditional Formatting or VBA question
Posted by Adam S. on December 12, 2001 1:18 PM
Hey all,
Using validation, I have single input cell where you can only have the word "percentage" or "count".
My output cells have a basic if then statement that performs one of two calculations depending on the current value of the input cell.
As you may have already guessed, when the input cell is set to "percentage" the output cells use a formula that kicks out a percentage, when the input cell has it's value set to "count" the output cells kick out an integer value.
My problem involves the number formatting. If possible, I'd like to have the output cells automatically formatted as a percentage (with one decimal place) when the input cell is set to "percentage". When the input cell is set to "count", I'd like the format to be automatically set to a standard number format (zero decimal places).
I attempted conditional formatting, but the "number" tab where you'd normally see under format\cells were curiously missing.
I was able to use a basic macro that simply formats the output range depending on the Input cell's current value, but I do not know the code for having the macro run everytime the Input cell is changed (assuming there is one). So at this point I have to manually run the macro to force the format change.
My question: Is there a way to automatically format these output cells (by percentage/number/decimal places) with a change in an input cell?
Any ideas would be helpful. Thanks!
Adam S.