PC Review


Reply
Thread Tools Rate Thread

Color cells if

 
 
Ymtrader
Guest
Posts: n/a
 
      28th Jun 2008
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 With Quote
 
 
 
 
RyanH
Guest
Posts: n/a
 
      28th Jun 2008
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.

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      28th Jun 2008
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
(E-Mail Removed)
"Ymtrader" <(E-Mail Removed)> wrote in message
news:90ECD6D7-2DBE-492B-9775-(E-Mail Removed)...
>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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to color automatically color code sums in cells JE McGimpsey Microsoft Excel Charting 0 29th Nov 2006 03:16 AM
How do I apply color in cells ..color now shown only in print prev =?Utf-8?B?Ym9uYWRpbWk=?= Microsoft Excel Worksheet Functions 1 25th Apr 2006 07:34 PM
change fill color of a range of cells based on color of a cell? =?Utf-8?B?RGFyTWVsTmVs?= Microsoft Excel Programming 0 2nd Mar 2006 06:35 PM
Excel 2003 will not display color fonts or color fill cells =?Utf-8?B?RGF2ZUM=?= Microsoft Excel Worksheet Functions 1 11th Apr 2005 04:38 PM
My excel 2003 wont let me fill cells with color or color the tabs. =?Utf-8?B?dHJpem9n?= Microsoft Excel New Users 2 22nd Feb 2005 06:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:08 PM.