View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Stumped: If a cell contains a formula, can you make text colorautomatically change?

You can create a userdefined function that returns true or false if the cell
contains a formula:

Option Explicit
Function HasFormula(rng As Range) As Boolean
Set rng = rng.Cells(1)
HasFormula = rng.HasFormula
End Function

Then you can include that test in your formula:

=hasformula(a1)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm



qwopzxnm wrote:

Max and Pete thank you both for your replies.

Max - Your method works great however if I continue to add formulas to
the worksheet I would need to keep repeating this each time. Is ther a
way to automate this so that if I add a formula to a cell it will
automatically format the text?

Pete - To use conditional formatting, what formula works best to test
if a cell is a formula or not?

--
qwopzxnm
------------------------------------------------------------------------
qwopzxnm's Profile: http://www.excelforum.com/member.php...o&userid=27557
View this thread: http://www.excelforum.com/showthread...hreadid=529671


--

Dave Peterson