View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Conditional format if cell contains formula

You can use a UDF (user defined function):

Function IsFormula(cell_ref As Range)
IsFormula = cell_ref.HasFormula
End Function

To use this:

Open the VBE editor: ALT F11
Open the Project Explorer: CTRL R
Locate your file name in the project explorer pane on the left.
Right click the file name
Select: InsertModule
Copy the code above and paste into the window on the right
Return back to Excel: ALT Q

Set the conditional formatting...
Select the cell(s) in question. Assume this is cell A1.
Goto FormatConditional Formatting
Formula Is: =IsFormula(A1)
Click the Format button
Select the desired style(s)
OK out


--
Biff
Microsoft Excel MVP


"Jean-Marc" wrote in message
...
Is there a way (conditional formatting?) to apply a different format to
cells
that contain a formula, as opposed to cells that have a directly entered
value?