![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Mar 2005
Location: Las Vegas
Posts: 166
|
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. |
|
|
|
|
|
#2 |
|
Join Date: Jun 2004
Location: Gray Cube, Nashville TN
Posts: 356
|
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. |
|
|
|
|
|
#3 |
|
Join Date: Mar 2005
Location: Las Vegas
Posts: 166
|
i'm envisioning a msgBox containing the properties of a clicked cell. THAT would be ideal
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Mar 2004
Location: Belgium 3272 Testelt
Posts: 16,994
|
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 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 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 |
|
|
|
|
|
#5 |
|
Join Date: Mar 2005
Location: Las Vegas
Posts: 166
|
Thanks yet again Erik!
|
|
|
|
|
|
#6 |
|
Join Date: Jun 2004
Location: Gray Cube, Nashville TN
Posts: 356
|
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. |
|
|
|
|
|
#7 |
|
MrExcel MVP
Join Date: Mar 2004
Location: Belgium 3272 Testelt
Posts: 16,994
|
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 Erik
__________________
I love Jesus piano improvisation Abba Father email Erik founder of DRAFT my free Addins Table-It download & info Formula Translator 04 |
|
|
|
|
|
#8 | |
|
Join Date: Mar 2005
Location: Las Vegas
Posts: 166
|
Quote:
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
|
|
|
|
|
|
|
#9 |
|
MrExcel MVP
Join Date: Mar 2004
Location: Belgium 3272 Testelt
Posts: 16,994
|
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 |
|
|
|
|
|
#10 | |
|
Join Date: Mar 2005
Location: Las Vegas
Posts: 166
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|