MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Feb 26th, 2002, 03:38 AM   #1
Joanna_gr
Board Regular
 
Join Date: Feb 2002
Location: Athens Greece
Posts: 147
Default

Hi again!

I want to apply special formatting to cells that contain formulas.
I think u've already answered this but i don't know where to locate the answer. Can u please help me?
Thanx
Joanna_gr is offline   Reply With Quote
Old Feb 26th, 2002, 03:59 AM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,314
Default

Quote:
On 2002-02-26 02:38, Joanna_gr wrote:
Hi again!

I want to apply special formatting to cells that contain formulas.
I think u've already answered this but i don't know where to locate the answer. Can u please help me?
Thanx
Joanna,

You need a user-defined function which can test whether a cell houses a formula:

VBA is not my PL (neither COBOL, by the way), but you can insert the following code in a module in your WB:

Function HoldsFormula(Cell) As Boolean
HoldsFormula = Cell.Range("A1").HasFormula
End Function

Now you can apply Cond Format to, B1:B10, a range of interest:

Select B1:B10;
Activate Format|Conditional Formatting;
Choose "Formula Is" for Condition 1;
Enter in the formula box:

=HoldsFormula(B1) [ important: don't freeze B1 by using F4 -- that is, no $$ here ]

Activate Format;
Choose a color on the Patterns tab;
Click OK, OK.

Aladin
Aladin Akyurek is offline   Reply With Quote
Old Feb 26th, 2002, 05:03 AM   #3
Derek
Board Regular
 
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
Default

Someone did post a clever answer to this some time ago. I have forgotten the author so I am sorry I can't give credit. As I remember it, it went:

Select all cells
At the toolbar select Insert,Name, Define
In "Names in Workbook" type "formula" (do NOT use quotation marks)
In "Refers to.." type GET.CELL(48,A1)
with all cells still selected go to Format, Conditional Formatting
Change "Cell value is" to "Formula is" and type in = "formula" (do NOT use quotation marks)
Select a coloured pattern and click OK
This should highlight all cells with formulas
Check conditional formattting again to ensure there are no quote marks around the word formula that you typed in.
regards
Derek

Derek is offline   Reply With Quote
Old Feb 26th, 2002, 05:42 AM   #4
Joanna_gr
Board Regular
 
Join Date: Feb 2002
Location: Athens Greece
Posts: 147
Default

Thanx Derek, Aladin

Derek, it worked. thank u very much. Can u please explain to me what CELL(48,A1) refers to? thanx again.
Joanna_gr is offline   Reply With Quote
Old Feb 26th, 2002, 06:00 AM   #5
Derek
Board Regular
 
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
Default

Hi Joanna
I must be honest I haven't the faintest idea what =GET.CELL(48,A1) really means. It was posted sometime ago by one of the gurus, and I'm sure if he/she reads this they will be happy to tell us. I tried different numbers from 48 to see if other magic things happened, but no, it seems 48 has some kind of special significance. Guys here seem willing to share all sorts of amazing stuff and I have received lots of help (I wish I could pretend I understand it all)
Good Luck
Derek
Derek is offline   Reply With Quote
Old Feb 26th, 2002, 06:13 AM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,314
Default

Quote:
On 2002-02-26 05:00, Derek wrote:
Hi Joanna
I must be honest I haven't the faintest idea what =GET.CELL(48,A1) really means. It was posted sometime ago by one of the gurus, and I'm sure if he/she reads this they will be happy to tell us. I tried different numbers from 48 to see if other magic things happened, but no, it seems 48 has some kind of special significance. Guys here seem willing to share all sorts of amazing stuff and I have received lots of help (I wish I could pretend I understand it all)
Good Luck
Derek
Here is a link to get more info:

http://www.j-walk.com/ss/excel/usertips/tip045.htm
Aladin Akyurek is offline   Reply With Quote
Old Feb 26th, 2002, 06:49 AM   #7
Juan Pablo González
MrExcel MVP
 
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
Default

Derek, thanks... this was me. Posted as a Tip of the Day, for whoever needs it again.

This uses Excel 4 macros (Get.Cell is a "command"), and the 48 is just a parameter... there are a lot of parameters for cells (60 or 70 if i'm correct), and each one has it's own meaning !

http://www.mrexcel.com/weblog/archiv..._webloga.shtml

Tip for Tuesday, Dec 18th. 2001.

Quote:
On 2002-02-26 05:00, Derek wrote:
Hi Joanna
I must be honest I haven't the faintest idea what =GET.CELL(48,A1) really means. It was posted sometime ago by one of the gurus, and I'm sure if he/she reads this they will be happy to tell us. I tried different numbers from 48 to see if other magic things happened, but no, it seems 48 has some kind of special significance. Guys here seem willing to share all sorts of amazing stuff and I have received lots of help (I wish I could pretend I understand it all)
Good Luck
Derek
__________________
Regards,

Juan Pablo González
http://www.juanpg.com
Juan Pablo González is offline   Reply With Quote
Old Feb 26th, 2002, 06:56 AM   #8
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,314
Default

I noticed that too late!


Quote:
On 2002-02-26 05:49, Juan Pablo G. wrote:
Derek, thanks... this was me. Posted as a Tip of the Day, for whoever needs it again.

This uses Excel 4 macros (Get.Cell is a "command"), and the 48 is just a parameter... there are a lot of parameters for cells (60 or 70 if i'm correct), and each one has it's own meaning !

http://www.mrexcel.com/weblog/archiv..._webloga.shtml

Tip for Tuesday, Dec 18th. 2001.

Quote:
On 2002-02-26 05:00, Derek wrote:
Hi Joanna
I must be honest I haven't the faintest idea what =GET.CELL(48,A1) really means. It was posted sometime ago by one of the gurus, and I'm sure if he/she reads this they will be happy to tell us. I tried different numbers from 48 to see if other magic things happened, but no, it seems 48 has some kind of special significance. Guys here seem willing to share all sorts of amazing stuff and I have received lots of help (I wish I could pretend I understand it all)
Good Luck
Derek
Aladin Akyurek is offline   Reply With Quote
Old Feb 26th, 2002, 07:29 AM   #9
Autolycus
 
Join Date: Feb 2002
Posts: 39
Default

I would not recommend using this method of identifying cells with formulas.
Cells that have this conditional formatting cannot be copied and pasted to other worksheets and attempting to do so might cause Excel to crash.

I use these macros to identify formulas and to remove the identification :-


Sub IdentifyFormulae_Add()
Dim ws As Worksheet
For Each ws In ActiveWindow.SelectedSheets
With ws.UsedRange
'Remove cell highlights (in case there _
are any cells highlighted but without _
formulae)
.Interior.ColorIndex = 0
'Identify Formulae
On Error GoTo e 'Error handler if there are no formula cells
.SpecialCells(xlFormulas).Interior.ColorIndex = 20
End With
Range("A1").Select
Next
Exit Sub
e: MsgBox "There are no cells with formulas"
End Sub

Sub IdentifyFormulae_Remove()
'Remove Identify Formulae (removes all _
cell highlights in the selection)
Selection.Interior.ColorIndex = 0
Range("A1").Select
End Sub
Autolycus is offline   Reply With Quote
Old Feb 26th, 2002, 07:38 AM   #10
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,314
Default

Quote:
On 2002-02-26 06:29, Autolycus wrote:
I would not recommend using this method of identifying cells with formulas.
Cells that have this conditional formatting cannot be copied and pasted to other worksheets and attempting to do so might cause Excel to crash.
That's interesting. Thanks pointing out.

Aladin
Aladin Akyurek is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 08:02 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes