Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Color cell font text based on cell type? How do it.

I can write vba code but this has me stumped. Does anyone have an
idea how to format cell text color by the property of the type of cell
it is?

For example if the cell is a constant the font would be red, if the
cell has a formula in it then it would be blue, and if the cell is
linked to another part of the workbook then it would be green.

I would be greatful for any ideas.

Thanks,

Chet
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Color cell font text based on cell type? How do it.

Sub ColorSpecialCellsFont()
'The If statement avoids error message
Set myRange = Sheets(1).Range("b2:b6")
If Not myRange.SpecialCells(xlCellTypeFormulas).Count < 1 Then
myRange.SpecialCells(xlCellTypeFormulas).Font.Colo rIndex = 3
End If
End Sub

"Chet" wrote:

I can write vba code but this has me stumped. Does anyone have an
idea how to format cell text color by the property of the type of cell
it is?

For example if the cell is a constant the font would be red, if the
cell has a formula in it then it would be blue, and if the cell is
linked to another part of the workbook then it would be green.

I would be greatful for any ideas.

Thanks,

Chet

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Color cell font text based on cell type? How do it.

On Nov 21, 5:54*pm, JLGWhiz wrote:
Sub ColorSpecialCellsFont()
* *'The If statement avoids error message
* *Set myRange = Sheets(1).Range("b2:b6")
* *If Not myRange.SpecialCells(xlCellTypeFormulas).Count < 1 Then
* * *myRange.SpecialCells(xlCellTypeFormulas).Font.Col orIndex = 3
* *End If
End Sub



"Chet" wrote:
I can write vba code but this has me stumped. *Does anyone have an
idea how to format cell text color by the property of the type of cell
it is?


For example if the cell is a constant the font would be red, if the
cell has a formula in it then it would be blue, and if the cell is
linked to another part of the workbook then it would be green.


I would be greatful for any ideas.


Thanks,


Chet- Hide quoted text -


- Show quoted text -


I kind of understand you are doing this, but how would i detect cells
where that particular cell is linked to another cell?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Color cell font text based on cell type? How do it.


In that case you look for precedents.

ActiveCell.ShowPrecedents





"Chet" wrote:

On Nov 21, 5:54 pm, JLGWhiz wrote:
Sub ColorSpecialCellsFont()
'The If statement avoids error message
Set myRange = Sheets(1).Range("b2:b6")
If Not myRange.SpecialCells(xlCellTypeFormulas).Count < 1 Then
myRange.SpecialCells(xlCellTypeFormulas).Font.Colo rIndex = 3
End If
End Sub



"Chet" wrote:
I can write vba code but this has me stumped. Does anyone have an
idea how to format cell text color by the property of the type of cell
it is?


For example if the cell is a constant the font would be red, if the
cell has a formula in it then it would be blue, and if the cell is
linked to another part of the workbook then it would be green.


I would be greatful for any ideas.


Thanks,


Chet- Hide quoted text -


- Show quoted text -


I kind of understand you are doing this, but how would i detect cells
where that particular cell is linked to another cell?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Color cell font text based on cell type? How do it.

Can you clarify something for me? What exactly do you mean when you say "if
the cell is linked to another part of the workbook"?

--
Rick (MVP - Excel)


"Chet" wrote in message
...
On Nov 21, 5:54 pm, JLGWhiz wrote:
Sub ColorSpecialCellsFont()
'The If statement avoids error message
Set myRange = Sheets(1).Range("b2:b6")
If Not myRange.SpecialCells(xlCellTypeFormulas).Count < 1 Then
myRange.SpecialCells(xlCellTypeFormulas).Font.Colo rIndex = 3
End If
End Sub



"Chet" wrote:
I can write vba code but this has me stumped. Does anyone have an
idea how to format cell text color by the property of the type of cell
it is?


For example if the cell is a constant the font would be red, if the
cell has a formula in it then it would be blue, and if the cell is
linked to another part of the workbook then it would be green.


I would be greatful for any ideas.


Thanks,


Chet- Hide quoted text -


- Show quoted text -


I kind of understand you are doing this, but how would i detect cells
where that particular cell is linked to another cell?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Color cell font text based on cell type? How do it.

On Nov 22, 7:24*am, "Rick Rothstein"
wrote:
Can you clarify something for me? What exactly do you mean when you say "if
the cell is linked to another part of the workbook"?

--
Rick (MVP - Excel)

"Chet" wrote in message

...
On Nov 21, 5:54 pm, JLGWhiz wrote:





Sub ColorSpecialCellsFont()
'The If statement avoids error message
Set myRange = Sheets(1).Range("b2:b6")
If Not myRange.SpecialCells(xlCellTypeFormulas).Count < 1 Then
myRange.SpecialCells(xlCellTypeFormulas).Font.Colo rIndex = 3
End If
End Sub


"Chet" wrote:
I can write vba code but this has me stumped. Does anyone have an
idea how to format cell text color by the property of the type of cell
it is?


For example if the cell is a constant the font would be red, if the
cell has a formula in it then it would be blue, and if the cell is
linked to another part of the workbook then it would be green.


I would be greatful for any ideas.


Thanks,


Chet- Hide quoted text -


- Show quoted text -


I kind of understand you are doing this, but how would i detect cells
where that particular cell is linked to another cell?- Hide quoted text -

- Show quoted text -


I wasn't very clear and I gave it some more thought. I'm trying to
show cells in three different ways.

1. A constant just entered as a number
2. A direct link where a cell has contents something like =A5 or
=Sheet2!B8
3. Any other type of formula such as =vlookup(a4,b4:b9,2,0). I
realize that this item is probably a subset of #2 but I am trying to
change the font color on something like this and make it different
than #2. (and different than #1)

Thanks,
Chet
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Font color based on font type or size John Excel Discussion (Misc queries) 2 February 7th 08 12:50 AM
how do i change row font color based on cell value in that row brianatkraft Excel Worksheet Functions 5 November 2nd 06 08:53 PM
How to sum data based on font or cell color? techiesol Excel Worksheet Functions 6 May 24th 06 04:11 PM
change font color of cell based on critera amrezzat Excel Worksheet Functions 1 November 20th 05 03:54 PM
Change Font Color in cell Based on another cell value John Excel Programming 2 November 18th 05 05:28 PM


All times are GMT +1. The time now is 06:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"