Solved

Conditional Formatting in excel Based - Cells with and without Formulas

Posted on 2011-03-22
4
220 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 19

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 19

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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