Thread: Color cells if
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RyanH RyanH is offline
external usenet poster
 
Posts: 586
Default Color cells if

Yes that is possible to do. I'm not sure where your "Totals", thus I can't
write code to find them. So I will have to make some assumptions. Assuming
you have the word "Totals" in Col. A and the actual totals range is next to
"Totals", this should work for you. I highlighted the Font Red.

Sub ColorTotals()

Dim myTotalRow As Long

myTotalRow = Sheets("Sheet1").Range("A:A").Find("Totals").Row

Sheets("Sheet1").Range(Cells(myTotalRow, 2), Cells(myTotalRow,
8)).Font.Color = vbRed

End Sub

Hope this helps!
--
Cheers,
Ryan


"Ymtrader" wrote:

I have a spreadsheet in which daily data was imported. At the end of each day
I need to color 1 row 7 columns wide (as if to make a line that inlcudes the
totals), these colored cells contain totals for the day. How might I
automate this. It takes so long to go through by hand. Any ideas
appreciated. Thanks.