LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Apply Conditional formatting if cell contains formula

Cell background has to be changed, if the cell doesn't contain formula.

I have tried implementing it in following ways

I have tried changing the cell back ground using Conditional formatting with
User Defined function(to check if cell has formula or value); but, adding
User Defined function degrades the performance of the template.
I have tried changing background by executing VSTO code on Range Change
event. But, undo stack is lost and user is unable to undo the changes
I also tried using Excel 4.0 macro..please see the implementation below..

You can use Excel 4 macro in a defined name formula to check if cell has a
formula, using you example
do insertnamedefine, in the source box put

=GET.CELL(6,Sheet1!$A1)

and in the name box type in something descriptive like

FormulaIs

click OK


Select A1:A3
with A1 as the active cell, do formatconditional formatting, select formula
is
and use

=LEFT(FormulaIs)="="

or in a pedagogic manner

=LEFT(FormulaIs,1)="="

you can actually leave out 1 if you just want one character

now click the format button and select format and click OK twice

But, I cannot use this method, because I get a security warning for Excel
4.0 macros when I open the template.


Is there any other way of checking if a cell contains formula in conditional
formatting?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apply Conditional Formatting If Data in More Than 1 Cell Matches Maureen Excel Discussion (Misc queries) 5 March 5th 09 03:35 PM
Apply conditional formatting to individual cell Excel 2007 James D Excel Worksheet Functions 3 June 3rd 07 09:59 PM
Conditional Formatting -- Apply to Row if Cell Value does not Matc SteveC Excel Programming 2 June 21st 06 06:17 PM
apply conditional formatting to negative cell values dona Excel Discussion (Misc queries) 2 March 10th 06 12:04 PM
How does special formula apply to conditional formatting? Frances Excel Discussion (Misc queries) 1 August 22nd 05 01:09 PM


All times are GMT +1. The time now is 10:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"