Solved

Conditional Formatting in excel Based - Cells with and without Formulas

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

758 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

18 Experts available now in Live!

Get 1:1 Help Now