Conditional Formatting Excel Macro


You can perform automated calculations using the for next loop or the do while loop. Now you can isert a few lines of code using the IF function and format your data based on specific condtions. Thus you can automate the conditional formatting process too.
The code now looks like this:
Sub calculations()
For Row = 3 To 10
Cells(Row, 4) = Cells(Row, 3) * Cells(Row, 2)
Cells(Row, 5) = Cells(Row, 4) * 0.125
Cells(Row, 6) = Cells(Row, 4) + Cells(Row, 5)
If Cells(Row, 6) >= 3000 Then
Cells(Row, 6).Font.ColorIndex = 3
End If

Next Row
End Sub

You can view the online training video to understand the extra code and further details.



Watch the training video on YouTube

Conditional Formatting Excel Macro