ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional formatting using VB (https://www.excelbanter.com/excel-programming/285231-conditional-formatting-using-vbulletin.html)

deelish

Conditional formatting using VB
 
I am a very novice programmer...actually to be completely honest, I kno
absolutely nothing about programming VB in Excel. What I would like t
do is write something that will help me do the following:

If cell A2 is greater than 30 and cell B2 says "yes", then have cell B
fill in red.

I would like to do this throughout the spreadsheet until there are n
more entries in either column, and I would like this to occu
automatically (i.e., without having to hit a button).

Thank you so much..

--
Message posted from http://www.ExcelForum.com


Greg Wilson[_4_]

Conditional formatting using VB
 
As I read your post, you don't need VBA to create the
conditional formatting (CF). Just use Excel's CF feature
and use the "Formula Is" option.

Suggested is the following:
1) First select all the desired cells in Column B.
2) Select Format|Conditional Formatting in the Worksheet
Menu Bar.
3) Select the "Formul Is" option from the drop list.
4) Insert the fomula: =And(A1 30, B1 = "Yes")
5) Click the Format button.
6) Select the Patterns tab.
7) Click the red square in the colour palette.
8) Click OK.

Note that when you select multiple cells and apply
conditional formatting to the entire range then the
formatting is applied relative to the first cell in the
selection. In the case above, if Cell B2 says "Yes" and
Cell A2 30 then B2 will be coloured red. And if Cell B3
says "Yes" and Cell A3 30 then B3 will be coloured red
and so on. As I read your post this is what you wanted.

Regards,
Greg



-----Original Message-----
I am a very novice programmer...actually to be completely

honest, I know
absolutely nothing about programming VB in Excel. What I

would like to
do is write something that will help me do the following:

If cell A2 is greater than 30 and cell B2 says "yes",

then have cell B2
fill in red.

I would like to do this throughout the spreadsheet until

there are no
more entries in either column, and I would like this to

occur
automatically (i.e., without having to hit a button).

Thank you so much...


---
Message posted from http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 05:48 PM.

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