OUTLOOK CONDITIONAL FORMATTING IF ELSE CODE
Whereas number code 1 is assigned to Black color and number 56 is assigned to Dark grey color. And for yellow we have color code assigned to it as 4.įor each color, we have different color codes assigned to them which is starting from 1 to 56. Else if the cell value of any cell from the selected range is 2 then interior color of that cell will be Yellow. And for green, we have color code assigned to it as 6.Ĭode: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Step 8: Write the code, if the cell value is 1 then-Interior color the selected range cell which is from A1 to B8 will be Green. This is the region where we would assign the colors to all numbers and alphabets available in our range. Step 7: Now in that, again open an If-Else loop. And start that with selecting the Cell defined variable MyRange. Step 6: Now open a For Each-Next loop as shown below. Set MyRange = Worksheets("Sheet1").Range("A1:B8") And then select the range of those cells which we need to format. We can put the sequence also as 1 instead of writing Sheet1. Step 5: After that select the Worksheet where we want to apply the conditional formatting. Step 4: Use Set and choose the defined Range as shown below.
![outlook conditional formatting if else outlook conditional formatting if else](https://i.stack.imgur.com/1MA3o.png)
Or you can choose any other name instead of MyRange as per your choice. Step 3: Now write the code firstly define a variable MyRange as Range. Under condition 1, choose Formula Is from the drop down menu and then type this formula in the text box:įor the remaining 4 steps, check out the original article.Step 2: Once we do that, it will automatically activate the private subcategory and Target cell would be as Range.Ĭode: Private Sub Worksheet_SelectionChange( ByVal Target As Range) From the menu.Ĥ: Conditional formatting dialogue box will be appeared on the screen. To achieve this follow the step-by-step process:ġ: Select the cells of C column (Grade) where conditional formatting is to be applied.ģ: Choose Conditional Formatting. "." 60, and less than 70, then background color of the cell should be gray "." 70, and less than 80, then background color of the cell should be purpleĬ. If marks are greater than or equal to 80, and less than 90, then background color of the cell should be greenī. Then, time for some conditional formatting on column C for the following criteria:Ī. Then copy this function to all the required cells. If obtained marks are less than 60, then grade would be "Failed"įor above purpose, put this "IF" function in C4 column. "." 60, and less than 70, then grade would be "C"Ĥ. "." 70, and less than 80, then grade would be "B"ģ. If obtained marks are more than or equal to 80, and less than 90, then grade would be "A"Ģ.
![outlook conditional formatting if else outlook conditional formatting if else](https://www.thetraininglady.com/wp-content/uploads/2017/02/conditional-format-date-feat-1.jpg)
![outlook conditional formatting if else outlook conditional formatting if else](https://contexturesblog.com/wp-content/uploads/2012/06/ConditionalFormatDuplicate02.png)
This video shows an example of a student report being created, which has three simple items in the columns of the sheet, which are the names of the students, the marks obtained and the grades.Ĭolumn A and Column B are the inputs by the user and Column C is the grade of the students that is dependent on the following four criteria:ġ. If you're looking for a way to create a student report, Microsoft Excel makes it easy to create a wonderful spreadsheet with tons of information.