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 Mar 13th, 2002, 09:25 AM   #1
Robbinsl
New Member
 
Join Date: Mar 2002
Posts: 3
Default

I want to filter by font colour and MSKB Q213923 suggests defining a name with the formula GET.CELL(24,OFFSET(INDIRECT("A2"),ROW()-2,0)).

I want to understand how the formula is constructed, what it all means, so I can use it for different things. What's it all about??
Robbinsl is offline   Reply With Quote
Old Mar 13th, 2002, 03:59 PM   #2
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Quote:
On 2002-03-13 08:25, Robbinsl wrote:
I want to filter by font colour and MSKB Q213923 suggests defining a name with the formula GET.CELL(24,OFFSET(INDIRECT("A2"),ROW()-2,0)).

I want to understand how the formula is constructed, what it all means, so I can use it for different things. What's it all about??
GET.CELL is a macro function from the "old" Excel 4.0 macro language. It's 1st argument is Type_num. 24 corresponds to "Font color of the first character in the cell, as a number in the range 1 to 56. If font color is automatic, returns 0". It's 2nd (optional) argument is a reference which in this case is produced by the OFFSET function. OFFSET(INDIRECT("A2"),ROW()-2,0) produces a reference to the cell in column A that's on the same row as the active cell.

[ This Message was edited by: Mark W. on 2002-03-13 15:02 ]
Mark W. is offline   Reply With Quote
Old Mar 13th, 2002, 04:00 PM   #3
Arviragus
 
Join Date: Mar 2002
Posts: 33
Default

The GET.CELL function is part of the Excel4 Macro language (which was VBA's predecessor).
It cannot be used directly in a worksheet cell.
The syntax is :- GET.CELL(type_num, reference)
Type_num 24 returns the font color of the first character in the reference, as a number in the range 1 to 56. If the font color is set to automatic, it returns 0.

I will assume you are familiar with the OFFSET, INDIRECT & ROW functions, so :-
INDIRECT("A2") fixes the reference as cell A2.
ROW()-2 provides the number of rows to be offset from A2. So in row 2 the offset is 0, in row 3 it is 1, etc.

Post again if not clear.
Arviragus is offline   Reply With Quote
Old Mar 14th, 2002, 02:07 AM   #4
Robbinsl
New Member
 
Join Date: Mar 2002
Posts: 3
Default

Thank you to both Mark W. and Arviragus for you feedback. I would however appreciate some clarification of certain points.

My understanding (in plain english) of the GET.CELL(24,OFFSET(INDIRECT("A2"),ROW()-2,0)) function is:

"get the font colour format of the first character in the cell which is offset from cell A2. The degree of row offset equals the row number of the current row minus 2. The column offset is zero"

1.How can I make this a general formula which is not dependant on cell A2?

2.Why does GET.CELL work in a defined name and not as a worksheet formula?

3.On what grounds can a formula be used in a defined name? (I have never used a formula as a defined name and I cannot visualize how it works)

4.I have downloaded macrofun.hlp - it seems to contain several useful looking functions. Why are these not available in Excel 2000?

5.If these functions work in defined names, why are they not supported in Excel help - this seems disempowering to the user?

I look forward to hearing your reply

Regards

Lucy



_________________


[ This Message was edited by: Robbinsl on 2002-03-14 01:08 ]
Robbinsl is offline   Reply With Quote
Old Mar 14th, 2002, 06:07 AM   #5
Arviragus
 
Join Date: Mar 2002
Posts: 33
Default

See comments below >>>

Quote:
On 2002-03-14 01:07, Robbinsl wrote:
Thank you to both Mark W. and Arviragus for you feedback. I would however appreciate some clarification of certain points.

My understanding (in plain english) of the GET.CELL(24,OFFSET(INDIRECT("A2"),ROW()-2,0)) function is:

"get the font colour format of the first character in the cell which is offset from cell A2. The degree of row offset equals the row number of the current row minus 2. The column offset is zero"

1.How can I make this a general formula which is not dependant on cell A2?

>>> Actually it is a general formula. One cell must be used as a starting point (or fix) in order to return the color(s) of the required cell(s). For instance, you could put this in the Name's RefersTo box :-
=GET.CELL(24,OFFSET(INDIRECT("A1"),ROW()-1,COLUMN()-2))
Then, entering =Red_Cell in any cell would return the color ref number of the cell immediately to the left.
It's really a question of using a formula in the RefersTo box that takes account of where you want the worksheet formula put in relation to the cell being checked.

2.Why does GET.CELL work in a defined name and not as a worksheet formula?

>>> It is part of a programming language, not a worksheet formula.
From a positive viewpoint, it is good that it can be used at all, even though indirectly.

3.On what grounds can a formula be used in a defined name? (I have never used a formula as a defined name and I cannot visualize how it works)

>>> In fact, formulas are always used in all defined names. The RefersTo box must always start with "=".
John Walkenbach says :-
"When you create a name, you're actually creating a named formula - a formula that doesn't exist in a cell. Rather, these named formulas exist in Excel's memory."
For named formulas (as opposed to named ranges - although they are really no different), try for example putting in the RefersTo box =A1+A2+A3

4.I have downloaded macrofun.hlp - it seems to contain several useful looking functions. Why are these not available in Excel 2000?

>>> They are the old Excel4Macro language. They have been replaced (mostly) by VBA. Any that are not covered by VBA can still be called in VBA procedures.
(I suppose it's the same as asking why can't all the things that can be done by VBA also be done by normal worksheet functions.)

5.If these functions work in defined names, why are they not supported in Excel help - this seems disempowering to the user?

>>> I think this is a question for Microsoft.
Bear in mind though that many of the functions in Macrofun are covered by Excel's normal capabilities and, if not, are covered by VBA.
Perhaps MS doesn't want to confuse the issue by including bits of an old macro language in Excel help - it is practical to use very few of the functions in named formulas (nor necessary to do so).


I look forward to hearing your reply

Regards

Lucy



_________________


[ This Message was edited by: Robbinsl on 2002-03-14 01:08 ]
Arviragus 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 10:22 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