Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change font colour


Hello,

Is there a way I can change the font colour to red in the entire row
based on a value in a cell using an IF statment without using the
Conditional Formatting ?

Thanks,


--
Altec101
------------------------------------------------------------------------
Altec101's Profile: http://www.excelforum.com/member.php...o&userid=34539
View this thread: http://www.excelforum.com/showthread...hreadid=546494

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Change font colour

Nope... Formulas return values. They do not manipulte the format of cells.
Why not use conditional formats???
--
HTH...

Jim Thomlinson


"Altec101" wrote:


Hello,

Is there a way I can change the font colour to red in the entire row
based on a value in a cell using an IF statment without using the
Conditional Formatting ?

Thanks,


--
Altec101
------------------------------------------------------------------------
Altec101's Profile: http://www.excelforum.com/member.php...o&userid=34539
View this thread: http://www.excelforum.com/showthread...hreadid=546494


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change font colour


So if I have a date in let say cell B2 and I have a if statment in a
macro that looks at the date in that cell and compares it with the
currenty system date, if the dates match I want it to colour the row
red if not skip that row and check the next one.

This can not be done ??????

I'm trying to make it as easy as posiable for some else can just run a
macro with out havn't to setup conditional formatting.


--
Altec101
------------------------------------------------------------------------
Altec101's Profile: http://www.excelforum.com/member.php...o&userid=34539
View this thread: http://www.excelforum.com/showthread...hreadid=546494

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Change font colour

Sub ColourRed()
If ActiveCell.Value = Date Then
ActiveCell.EntireRow.Interior.ColorIndex = 3
End If
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with googlemail if mailing direct)

"Altec101" wrote in
message ...

So if I have a date in let say cell B2 and I have a if statment in a
macro that looks at the date in that cell and compares it with the
currenty system date, if the dates match I want it to colour the row
red if not skip that row and check the next one.

This can not be done ??????

I'm trying to make it as easy as posiable for some else can just run a
macro with out havn't to setup conditional formatting.


--
Altec101
------------------------------------------------------------------------
Altec101's Profile:

http://www.excelforum.com/member.php...o&userid=34539
View this thread: http://www.excelforum.com/showthread...hreadid=546494



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Change font colour

Sorry... I misunderstood your question. So if I have it straight you want a
macro to look though a group of cells and colour the entire row red if the
cell value equals the system date... This is untested but it should be close.

Sub MakeRed()
dim rngToSearch as range
dim rng as range

set rngtosearch = range("B2", cells(rows.count, "B").end(xlUp))
for each rng in rngToSearch
if rng.value = date(now()) then rng.entirerow.font.colorindex = 3
next rng
end Sub
--
HTH...

Jim Thomlinson


"Altec101" wrote:


So if I have a date in let say cell B2 and I have a if statment in a
macro that looks at the date in that cell and compares it with the
currenty system date, if the dates match I want it to colour the row
red if not skip that row and check the next one.

This can not be done ??????

I'm trying to make it as easy as posiable for some else can just run a
macro with out havn't to setup conditional formatting.


--
Altec101
------------------------------------------------------------------------
Altec101's Profile: http://www.excelforum.com/member.php...o&userid=34539
View this thread: http://www.excelforum.com/showthread...hreadid=546494




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change font colour


Hello Altec101,

Place this code in a standard VBA module. It will compare the active
cell's contents to the System Date. If there is a match, it change the
Row's Font color to red.


Code:
--------------------
Sub MakeRowFontRed()

If ActiveCell.Value = Date Then
With ActiveCell.EntireRow
.Select
.Font.Color = RGB(255, 0, 0)
End With
End If

End Sub

--------------------


Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=546494

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change font colour


Thanks guys for the help.

How can I get it to loop through a range of cells say in column F.
I would like to to check each cell in column F one after the other(the
number of cells can be different each time) and be able to compare the
value in the cell which is a date to the systems date, if the value is
greater then or equal to the systems date colour the cell font red if
not do nothing.


--
Altec101
------------------------------------------------------------------------
Altec101's Profile: http://www.excelforum.com/member.php...o&userid=34539
View this thread: http://www.excelforum.com/showthread...hreadid=546494

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Change font colour


Sub ColourRed()
Dim i As Long
For i = 1 To Cells(Rows.Count, "F").End(xlUp)
If Cells(i, "F").Value = Date Then
Cells(i,"F").Font.ColorIndex = 3
End If
Next i
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with googlemail if mailing direct)

"Altec101" wrote in
message ...

Thanks guys for the help.

How can I get it to loop through a range of cells say in column F.
I would like to to check each cell in column F one after the other(the
number of cells can be different each time) and be able to compare the
value in the cell which is a date to the systems date, if the value is
greater then or equal to the systems date colour the cell font red if
not do nothing.


--
Altec101
------------------------------------------------------------------------
Altec101's Profile:

http://www.excelforum.com/member.php...o&userid=34539
View this thread: http://www.excelforum.com/showthread...hreadid=546494



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
Change font colour Min Excel Discussion (Misc queries) 9 February 18th 10 01:50 AM
FONT COLOUR CHANGE natasha90 Excel Worksheet Functions 3 July 11th 08 09:19 PM
Change font colour Stefi Excel Discussion (Misc queries) 1 March 28th 07 01:54 AM
Change font colour [email protected] Excel Discussion (Misc queries) 3 December 23rd 06 07:07 PM
Change font colour for whole row Saleee Excel Worksheet Functions 2 October 10th 06 06:41 PM


All times are GMT +1. The time now is 09:41 AM.

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

About Us

"It's about Microsoft Excel"