Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Change Row Color using VBA

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Change Row Color using VBA

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Change Row Color using VBA

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Change Row Color using VBA

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" wrote in message
...
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" wrote in message
...
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
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
Checkbox to change background color, font color and remove/ add bo Sara Excel Discussion (Misc queries) 2 May 1st 23 11:43 AM
how can I conditionally change font color, or background color? MOHA Excel Worksheet Functions 3 August 21st 06 06:57 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
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM
Browse Forms Controls and change TextBox color based on cell color StefanW Excel Programming 2 November 21st 04 07:06 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"