ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Conditional format if a cell has a formula or if a percent or numb (https://www.excelbanter.com/excel-discussion-misc-queries/98766-conditional-format-if-cell-has-formula-if-percent-numb.html)

wrightlife11

Conditional format if a cell has a formula or if a percent or numb
 
I need to change the color of a cell that contains a complicated formula if
someone types in a value. Any Ideas?

M

Gord Dibben

Conditional format if a cell has a formula or if a percent or numb
 
If someone types in a value, there will no longer be a complicated formula.

You would be better off protecting that cell from editing using
FormatCellProtection followed by ToolsProtectionProtect Sheet.

But.....................to answer your question.

Copy/paste this UDF to a General Module in your workbook.

Function IsFormula(cell)
Application.Volatile
IsFormula = cell.HasFormula
End Function

Select the cell to change color and FormatConditional FormattingFormula is:

Assuming the selection to be A1

Formula is: =NOT(IsFormula(A1))


Gord Dibben MS Excel MVP

On Tue, 11 Jul 2006 20:41:02 -0700, wrightlife11
wrote:

I need to change the color of a cell that contains a complicated formula if
someone types in a value. Any Ideas?

M




All times are GMT +1. The time now is 05:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com