Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How do i change font color in a range on Excel 2007

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 09-06-2009
Member
 
Join Date: Apr 2009
Posts: 91
How do i change font color in a range on Excel 2007
  

I would like to know that how do i change font color in a range on Excel 2007. Let say for example if i would like to create a worksheet in order to calculate money. If i get any negative amount then Excel should display the number in 'Red', while if it gives out positive number then it should display the number in 'Green'. Can any body tell me that how can i do it? Does any body knows about it? Kindly provide me the correct solution for the above issue.

Reply With Quote
  #2  
Old 09-06-2009
Member
 
Join Date: Jan 2008
Posts: 3,750
Re: How do i change font color in a range on Excel 2007

You can try out the following code:-

Quote:
Private Sub Worksheet_Change(ByVal Target As Range)
Static KeyCel As String
If StrComp(KeyCel, LCase$(CStr([x10].Value))) = 0 Then Exit Sub
Application.EnableEvents = False
With Range("L23")
.Value = "Of the $" & [x10].Value & " affiliate fee:"
.Font.Color = vbBlack
.Characters(Start:=8, Length:=Len([x10].Value) + 1).Font.Color = [x10].Font.Color
End With
KeyCel = LCase$([x10].Value)
Application.EnableEvents = True
End Sub
Reply With Quote
  #3  
Old 09-06-2009
Member
 
Join Date: Apr 2008
Posts: 4,086
Re: How do i change font color in a range on Excel 2007

If you want to put a color in a particular cell, then you can try out the following code:-

Quote:
=COUNTIF(AE10,"HD") + COUNTIF(AE10,"H") + COUNTIF(AE10,"T1")+ COUNTIF(AE10,"T2") + COUNTIF(AE10,"T3") + COUNTIF(AE10,"T4")+ COUNTIF(AE10,"T5")+ COUNTIF(AE10,"T6")+ COUNTIF(AE10,"T7")+ COUNTIF(AE10,"T7.5")
Reply With Quote
  #4  
Old 09-06-2009
Member
 
Join Date: May 2008
Posts: 3,312
Re: How do i change font color in a range on Excel 2007

If you want, you can even check out the following code:-

Quote:
Sub Color_Part_of_Cell()
'Print ActiveCell.Characters.Count
With ActiveCell.Characters(2).Font
.Color = RGB(36, 182, 36)
End With

With ActiveCell.Characters(2, 2).Font
.Color = RGB(36, 182, 36)
End With

With ActiveCell.Characters(, 2).Font
.Color = RGB(36, 182, 36)
End With

End Sub
Reply With Quote
Reply

  TechArena Community > Software > Windows Software
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How do i change font color in a range on Excel 2007"
Thread Thread Starter Forum Replies Last Post
How to change font color in taskbar of Windows 8 Anikait Customize Desktop 3 25-05-2013 10:55 AM
Not able to change font color in some cells of Microsoft Excel Garsen's MS Office Support 2 01-02-2012 01:08 PM
How To Change Font Color with CSS Vineeta Software Development 4 11-01-2010 02:55 AM
Change font color within Gantt bars Manik Microsoft Project 3 07-02-2009 01:12 AM
How to add color and change font size in signature rasena Windows Vista Mail 2 14-03-2008 08:30 PM


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