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 Jun 7th, 2005, 07:03 PM   #1
jayd4wg
 
Join Date: Mar 2005
Location: Las Vegas
Posts: 166
Default cell properties sniffer?

has anyone ever written a cell properties sniffer?

I'm trying to do a simple text and background color inverter, and when i go to white background with black text, i lose the fine gray outline. But later on, i'll be doing much more with it and it would be very helpful to know what the VBA properties are for certain cells.
jayd4wg is offline   Reply With Quote
Old Jun 7th, 2005, 08:17 PM   #2
chead5
 
chead5's Avatar
 
Join Date: Jun 2004
Location: Gray Cube, Nashville TN
Posts: 356
Default

Interesting question. Worth a bit of distraction I think. I'll get back to you if I find something
__________________
If you can't dazzle them with data. Baffle them with bull-@#*T.
chead5 is offline   Reply With Quote
Old Jun 7th, 2005, 08:36 PM   #3
jayd4wg
 
Join Date: Mar 2005
Location: Las Vegas
Posts: 166
Default

i'm envisioning a msgBox containing the properties of a clicked cell. THAT would be ideal
jayd4wg is offline   Reply With Quote
Old Jun 7th, 2005, 09:02 PM   #4
erik.van.geit
MrExcel MVP
 
erik.van.geit's Avatar
 
Join Date: Mar 2004
Location: Belgium 3272 Testelt
Posts: 16,994
Default

jayd4wg,

can you use this

Code:
Sub color_inverter()
'Erik Van Geit
'050607

Dim CC As Long
Dim FC As Long
Dim cell As Range

Application.ScreenUpdating = False

For Each cell In Selection
CC = cell.Interior.Color
FC = cell.Font.Color
cell.Interior.Color = FC
cell.Font.Color = CC
Next cell

Application.ScreenUpdating = False
End Sub
to display properties
Code:
For Each cell In Selection
msg = "Borders.Color" & vbTab & cell.Borders.Color & Chr(10) & _
"CurrentRegion" & vbTab & cell.CurrentRegion.Address(0, 0) & Chr(10) & _
"Formula" & vbTab & vbTab & cell.Formula
MsgBox msg, 64, "cell" & cell.Address(0, 0)
Next cell
typing cell and then a dot will give you a list of properties and instructions ... choose what you want

kind regards,
Erik
__________________
I love Jesus
piano improvisation Abba Father

email Erik

founder of DRAFT

my free Addins
Table-It download & info
Formula Translator 04
erik.van.geit is offline   Reply With Quote
Old Jun 7th, 2005, 09:37 PM   #5
jayd4wg
 
Join Date: Mar 2005
Location: Las Vegas
Posts: 166
Default

Thanks yet again Erik!
jayd4wg is offline   Reply With Quote
Old Jun 7th, 2005, 10:06 PM   #6
chead5
 
chead5's Avatar
 
Join Date: Jun 2004
Location: Gray Cube, Nashville TN
Posts: 356
Default

I there a way to loop thru all of the properties of a cell and list their states?
__________________
If you can't dazzle them with data. Baffle them with bull-@#*T.
chead5 is offline   Reply With Quote
Old Jun 7th, 2005, 10:28 PM   #7
erik.van.geit
MrExcel MVP
 
erik.van.geit's Avatar
 
Join Date: Mar 2004
Location: Belgium 3272 Testelt
Posts: 16,994
Default

would be intresting ...

it exists for workbooks
something like this
http://www.mrexcel.com/board2/viewtopic.php?t=111162

Code:
Sub shProps() 
Dim itemN, myItem, myList 

On Error Resume Next 
For Each p In ActiveWorkbook.BuiltinDocumentProperties 
itemN = p.Name 
myItem = p.Value 
myList = myList & vbCr & itemN & ": " & myItem 
Next 
MsgBox myList 
End Sub
kind regards,
Erik
__________________
I love Jesus
piano improvisation Abba Father

email Erik

founder of DRAFT

my free Addins
Table-It download & info
Formula Translator 04
erik.van.geit is offline   Reply With Quote
Old Jun 7th, 2005, 11:00 PM   #8
jayd4wg
 
Join Date: Mar 2005
Location: Las Vegas
Posts: 166
Default

Quote:
Originally Posted by chead5
I there a way to loop thru all of the properties of a cell and list their states?
This is how I came upon the correct colorIndex for the sheet I was working on:


Code:
Sub cellOutlines()
'Written by Jason Basham
'06-07-05
'Description - This cycles thru all available color index numbers, and 
'places an outline around the corresponding rows in column A
'ie. a1 is ColorIndex=1 and a28 is ColorIndex=28

Dim i As Integer
i = 1

    Do While i < 57'loop 57 times, the maximum ColorIndex value
            
            ActiveCell.Borders.LineStyle = xlContinuous
            ActiveCell.Borders.Weight = xlThin ' set to xlThick, will be easier to see
            ActiveCell.Borders.ColorIndex = i
            ActiveCell.Offset(1, 0).Select 'go to next cell down
            i = i + 1
    Loop

 End Sub
jayd4wg is offline   Reply With Quote
Old Jun 7th, 2005, 11:18 PM   #9
erik.van.geit
MrExcel MVP
 
erik.van.geit's Avatar
 
Join Date: Mar 2004
Location: Belgium 3272 Testelt
Posts: 16,994
Default

jayd4wg,

I think chead5's question was meant to display all kind of properties...
Any takers for that part ?

kind regards,
Erik
__________________
I love Jesus
piano improvisation Abba Father

email Erik

founder of DRAFT

my free Addins
Table-It download & info
Formula Translator 04
erik.van.geit is offline   Reply With Quote
Old Jun 8th, 2005, 04:25 AM   #10
jayd4wg
 
Join Date: Mar 2005
Location: Las Vegas
Posts: 166
Default

Quote:
Originally Posted by erik.van.geit
jayd4wg,

I think chead5's question was meant to display all kind of properties...
Any takers for that part ?

kind regards,
Erik
I was hoping to start some wheels turning in his head with what I posted. but then I thought...a single spreadsheet with all different properties might be kind of tedious...much more so than a sniffer to check the properties of an individual cell IMO. I'm not up to the task, at least not right now, my plate is FULL.
jayd4wg 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 +1. The time now is 04:27 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2010 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