Solved

Conditional Formatting in excel Based - Cells with and without Formulas

Posted on 2011-03-22
4
219 Views
Last Modified: 2012-05-11
1. i need a CF to color cells without formulas  column 1
2. i need a CF to color cells with formulas       column 2
0
Comment
Question by:ansonindustries
  • 2
4 Comments
 
LVL 18

Expert Comment

by:Raheman M. Abdul
ID: 35193744
0
 
LVL 33

Accepted Solution

by:
jppinto earned 500 total points
ID: 35193776
I've attached a working sample. I've used a UDF in VBA:

Function CellFormula(cel As Range) As String
    CellFormula = cel.Formula
End Function

This function will return the formula on a cell. Using this function on a Conditional Formatting rule, I check if the cell has a function (checking if it begins with a =) and on the first column, if it doesn't have a formula, I change the color (to yellow) on the second column, I check if it has a formula and if true change the color to orange.

Hope this is clear.

jppinto
ConditionalFormatting.xlsm
Capture.JPG
0
 
LVL 18

Expert Comment

by:Raheman M. Abdul
ID: 35193814
Replace with =NOT(IsFormula($B$3)) for the opposite function. ( is not the formula) select desired color
0
 

Author Closing Comment

by:ansonindustries
ID: 35194120
Thanks works great!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now