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

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Color cells if

Look in the vba help index for FINDNEXT.There is a good example to color all
rows with your find
Then modify to search for "Total"

c.resize(0,7).interior.colorindex=6

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ymtrader" wrote in message
...
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.


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
How to color automatically color code sums in cells kuroitenpi Charts and Charting in Excel 1 November 29th 06 03:16 AM
How do I apply color in cells ..color now shown only in print prev bonadimi Excel Worksheet Functions 1 April 25th 06 07:34 PM
change fill color of a range of cells based on color of a cell? DarMelNel Excel Programming 0 March 2nd 06 06:35 PM
Excel 2003 will not display color fonts or color fill cells DaveC Excel Worksheet Functions 1 April 11th 05 04:38 PM
My excel 2003 wont let me fill cells with color or color the tabs. trizog New Users to Excel 2 February 22nd 05 06:43 PM


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

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"