![]() |
Change entire row color
I know how to iterate down the rows, but how do I assign an entire row font color. To assign red or blue, would it be something like: if cells(i,1).Value = "Non-Interum Servicing" then Worksheet.Range.EntireRow.Font.Color = RGB(255, 0, 0) else if cells(i,1).Value = "Interum Servicing" then Worksheet.Range.EntireRow.Font.Color = RGB(0, 0, 255) end if end if Thanks in advance everyone -- mthoma ----------------------------------------------------------------------- mthomas's Profile: http://www.excelforum.com/member.php...fo&userid=2564 View this thread: http://www.excelforum.com/showthread.php?threadid=39078 |
Change entire row color
cells(i,1).EntireRow.Font.Color = RGB(255, 0, 0)
Regards Rowan "mthomas" wrote: I know how to iterate down the rows, but how do I assign an entire row a font color. To assign red or blue, would it be something like: if cells(i,1).Value = "Non-Interum Servicing" then Worksheet.Range.EntireRow.Font.Color = RGB(255, 0, 0) else if cells(i,1).Value = "Interum Servicing" then Worksheet.Range.EntireRow.Font.Color = RGB(0, 0, 255) end if end if Thanks in advance everyone! -- mthomas ------------------------------------------------------------------------ mthomas's Profile: http://www.excelforum.com/member.php...o&userid=25649 View this thread: http://www.excelforum.com/showthread...hreadid=390783 |
Change entire row color
Hi M,
Try something like: Sub AAA() Dim i As Long For i = 1 To 10 With Cells(i, 1) If .Value = "Non-Interum Servicing" Then .EntireRow.Font.Color = RGB(255, 0, 0) ElseIf .Value = "Interum Servicing" Then .EntireRow.Font.Color = RGB(0, 0, 255) End If End With Next i End Sub --- Regards, Norman "mthomas" wrote in message ... I know how to iterate down the rows, but how do I assign an entire row a font color. To assign red or blue, would it be something like: if cells(i,1).Value = "Non-Interum Servicing" then Worksheet.Range.EntireRow.Font.Color = RGB(255, 0, 0) else if cells(i,1).Value = "Interum Servicing" then Worksheet.Range.EntireRow.Font.Color = RGB(0, 0, 255) end if end if Thanks in advance everyone! -- mthomas ------------------------------------------------------------------------ mthomas's Profile: http://www.excelforum.com/member.php...o&userid=25649 View this thread: http://www.excelforum.com/showthread...hreadid=390783 |
All times are GMT +1. The time now is 02:56 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com