![]() |
![]() |
|
|||||||
| 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 |
|
New Member
Join Date: May 2002
Posts: 2
|
Can any one give me a formula that when i type in a single letter will automotically change the colour of the font. i.e t would show in the cell as in the colour blue. h would show as red |
|
|
|
|
|
#2 |
|
New Member
Join Date: Apr 2002
Posts: 41
|
Try Conditional Formatting.
- From the Main menu select Format/Conditional formatting - Leave "Cell Value is" - in the next box select "equal to" - next box type, say, t - Select the format button and then a red font. Cell font should now change to red if you type in a "t" You may amend that to anything you want. Any help? Regards Robb__ |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Hellas
Posts: 553
|
Hello
Try conditional formatting go to menu, format,conditional formatting,condition one,cell value is,equal to,t,font color blue then for the second letter add condition two,cell value is,equal to,h,font color red e.t.c. this works for 3 conditions only Hope that helps
__________________
Best Regards Andreas
|
|
|
|
|
|
#4 |
|
New Member
Join Date: May 2002
Posts: 2
|
Thank you to all who have replied. One additional problem i want to use more than the three required adjustments you can do on conditioning format.
Any advice appreciated |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi sufc.
List your ranges and each format based upon each condition. Tom |
|
|
|
|
|
#6 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
As Tom has said, [quote/] List your ranges and each format based upon each condition. Tom [/quote] |
|
|
|
|
|
|
#7 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
I agree with everyone else that the conditional formating is the way to go. However if you have more then 3 conditionals then droping this code into your VBA area for you specific sheet should meet your requirements.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
Select Case .Value
Case "t"
Cells(.Row, .Column).Font.ColorIndex = 5
Case "h"
Cells(.Row, .Column).Font.ColorIndex = 3
Case Else
Cells(.Row, .Column).Font.ColorIndex = 0
End Select
End With
End Sub
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
Select Case ucase(.Value)
Case "T"
Cells(.Row, .Column).Font.ColorIndex = 5
Case "H"
Cells(.Row, .Column).Font.ColorIndex = 3
Case Else
Cells(.Row, .Column).Font.ColorIndex = 0
End Select
End With
End Sub
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
With Target
Select Case .Value
Case "t"
Cells(.Row, .Column).Font.ColorIndex = 5
Case "h"
Cells(.Row, .Column).Font.ColorIndex = 3
Case Else
Cells(.Row, .Column).Font.ColorIndex = 0
End Select
End With
End Sub
[ This Message was edited by: Nimrod on 2002-05-26 12:59 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|