Re: 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" <HomeStarRunner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7CF192F4-C955-4627-ADB2-53A646128338@xxxxxxxxxxxxxxxx
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" <HomeStarRunner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D9453EE6-602D-45E4-A2A3-B184CFA1B111@xxxxxxxxxxxxxxxx
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.




.



Relevant Pages

  • Re: Copying Conditional Formatting to range of cells
    ... but CF has a dreadful habit of changing relative references to ... it sounds like you just need to make the conditional formatting ... but copying the absolute cell ref, and not making it relative (so $h$4 ...
    (microsoft.public.excel.worksheet.functions)
  • Re: sheet protected but cells "cleared of all" become locked
    ... conditional formatting in styles. ... But you can change the default style for this workbook. ... "lockedness" of that cell may not be what you want. ... This also resets the protection formatting for the cell, ...
    (microsoft.public.excel.misc)
  • Re: How to prevent underlying shade row color from moving in Sort
    ... > grey ... One way could it can be done is using the "Conditional Formatting" option ... In cell blank cell that's next ... Formatting" pane and make sure some extra quotes haven't been added to the ...
    (microsoft.public.mac.office.excel)
  • Re: Conditional Formatting - workdays only
    ... Microsoft Excel MVP ... Therefore, can I add a IF statement in here to say "If the cell is blank, ... Applied the conditional formatting: ... Conditional Formatting - highlight cell in red. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: training Out of date formula required
    ... I selected cell D3 and went to Format and then to the conditional formatting ...
    (microsoft.public.excel.programming)