ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Change cell background based on multiple cells (https://www.excelbanter.com/excel-worksheet-functions/151485-change-cell-background-based-multiple-cells.html)

[email protected]

Change cell background based on multiple cells
 
This is what I'm trying, unsuccessfully, to do:

If the value of A1 is "Hourly" AND the value of C3 is <10, change the
background to yellow
If the value of A1 is "Salary" AND the value of C3 is 14, change the
background to green

I have been unable to do this using conditional formatting.
Can someone help with VB?

Thanks!!


Peo Sjoblom

Change cell background based on multiple cells
 
Formula is

=AND($A$1="Hourly",$C$3<10)


2nd condition


=AND($A$1="Salary",$C$314)


works for me


--
Regards,

Peo Sjoblom

wrote in message
ups.com...
This is what I'm trying, unsuccessfully, to do:

If the value of A1 is "Hourly" AND the value of C3 is <10, change the
background to yellow
If the value of A1 is "Salary" AND the value of C3 is 14, change the
background to green

I have been unable to do this using conditional formatting.
Can someone help with VB?

Thanks!!




[email protected]

Change cell background based on multiple cells
 
Thanks!

Now I'm having another problem with it.

This is going to be part of a macro, and the number of rows may change
with each worksheet.

When I apply the formatting to the entire column, which includes a
header row, the highlighed cells are shifted up one row because the
header is included.
So my question is, how can I exclude the header and have the correct
cells highlighted?



All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com