Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change font colour | Excel Discussion (Misc queries) | |||
FONT COLOUR CHANGE | Excel Worksheet Functions | |||
Change font colour | Excel Discussion (Misc queries) | |||
Change font colour | Excel Discussion (Misc queries) | |||
Change font colour for whole row | Excel Worksheet Functions |