PC Review


Reply
Thread Tools Rate Thread

Change Row Color using VBA

 
 
HomeStarRunner
Guest
Posts: n/a
 
      4th Mar 2008
I have to admit that I'm no excel expert. I have been playing around with
VBA trying to format the color of a row. I use conditional formatting on
cell C1. If C1=Y then I turn it green. If C1=N then I turn it red. I would
like to know how to turn either the entire row a or a range (A1:A2) within
that row to follow the format of cell C1.
 
Reply With Quote
 
 
 
 
Gary Keramidas
Guest
Posts: n/a
 
      4th Mar 2008
you could select a1 & a2, then choose conditional formatting
select formula is from the dropdown and then pastes this in the box
=$C$1="Y"
then format the cells however you want

post back if i'm off base here.


--

Gary
Excel 2003


"HomeStarRunner" <(E-Mail Removed)> wrote in message
news9453EE6-602D-45E4-A2A3-(E-Mail Removed)...
>I have to admit that I'm no excel expert. I have been playing around with
> VBA trying to format the color of a row. I use conditional formatting on
> cell C1. If C1=Y then I turn it green. If C1=N then I turn it red. I
> would
> like to know how to turn either the entire row a or a range (A1:A2) within
> that row to follow the format of cell C1.


 
Reply With Quote
 
HomeStarRunner
Guest
Posts: n/a
 
      5th Mar 2008
Thanks Gary, that looks good. Now I try to copy the cell format of A1 and B1
to A2:B2. For example, I want A2:B2 to follow the same formatting if C2 is
changed to Y or N. I can't copy the formatting to A2:B2 as it keeps the same
conditional formatting to cell C1 where it needs to reference C2. Please
help if you are able. --Thanks

"Gary Keramidas" wrote:

> you could select a1 & a2, then choose conditional formatting
> select formula is from the dropdown and then pastes this in the box
> =$C$1="Y"
> then format the cells however you want
>
> post back if i'm off base here.
>
>
> --
>
> Gary
> Excel 2003
>
>
> "HomeStarRunner" <(E-Mail Removed)> wrote in message
> news9453EE6-602D-45E4-A2A3-(E-Mail Removed)...
> >I have to admit that I'm no excel expert. I have been playing around with
> > VBA trying to format the color of a row. I use conditional formatting on
> > cell C1. If C1=Y then I turn it green. If C1=N then I turn it red. I
> > would
> > like to know how to turn either the entire row a or a range (A1:A2) within
> > that row to follow the format of cell C1.

>
>

 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      5th Mar 2008
you'll need to remove the absolute reference to the row. use this in the
formula, then you'll be able to copy the format down the column. after you do,
just reopen the conditional formatting dialog and look at the formula. the row
number should change. in my original post, the row number would not have changed
and it would have referenced C1.


=$C1="Y"

--


Gary


"HomeStarRunner" <(E-Mail Removed)> wrote in message
news:7CF192F4-C955-4627-ADB2-(E-Mail Removed)...
> Thanks Gary, that looks good. Now I try to copy the cell format of A1 and B1
> to A2:B2. For example, I want A2:B2 to follow the same formatting if C2 is
> changed to Y or N. I can't copy the formatting to A2:B2 as it keeps the same
> conditional formatting to cell C1 where it needs to reference C2. Please
> help if you are able. --Thanks
>
> "Gary Keramidas" wrote:
>
>> you could select a1 & a2, then choose conditional formatting
>> select formula is from the dropdown and then pastes this in the box
>> =$C$1="Y"
>> then format the cells however you want
>>
>> post back if i'm off base here.
>>
>>
>> --
>>
>> Gary
>> Excel 2003
>>
>>
>> "HomeStarRunner" <(E-Mail Removed)> wrote in message
>> news9453EE6-602D-45E4-A2A3-(E-Mail Removed)...
>> >I have to admit that I'm no excel expert. I have been playing around with
>> > VBA trying to format the color of a row. I use conditional formatting on
>> > cell C1. If C1=Y then I turn it green. If C1=N then I turn it red. I
>> > would
>> > like to know how to turn either the entire row a or a range (A1:A2) within
>> > that row to follow the format of cell C1.

>>
>>



 
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
in EQUATION EDITION (WORD) change color(color of numbers and symbo =?Utf-8?B?ZnJhbmNpcyBpcyB0aGFua3MgdG8geW91IC4gLiAu Microsoft Word Document Management 1 29th Nov 2006 03:45 PM
change auto underline color for red/green color blindness =?Utf-8?B?T25zYmVyZw==?= Microsoft Word Document Management 1 23rd Sep 2006 04:17 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
Bullet Font Color Changes When I Change Text Color--Can I Change it Back? J. Danniel Microsoft Powerpoint 2 17th Mar 2005 08:06 PM
Browse Forms Controls and change TextBox color based on cell color =?Utf-8?B?U3RlZmFuVw==?= Microsoft Excel Programming 0 21st Nov 2004 04:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:53 AM.