Excel VBA | Conditional Formatting With VBA Code | Change Color Using VBA Code

Опубликовано: 09 Октябрь 2024
на канале: Aziz360
414
12

Dear Friends
In this video i am going to show you how to Change cell color based on cell value using VBA code.
Codes are bellow
=============================================================
Set I = Intersect(Target, Range("C3:C9"))
If Not I Is Nothing Then
Select Case Target
Case 0 To 30: NEWCOLOR = 3
Case 31 To 50: NEWCOLOR = 38
Case 51 To 80: NEWCOLOR = 5
Case 81 To 100: NEWCOLOR = 4
End Select
Target.Interior.ColorIndex = NEWCOLOR
End If

=========================================================

Thaks for watching.
aziz360