Change color for specific number of cells by value
Solved/Closed
ChrisK
-
Apr 17, 2018 at 05:49 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 19, 2018 at 10:47 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 19, 2018 at 10:47 AM
Related:
- Change color for specific number of cells by value
- Notepad++ change background color - Guide
- How to change number of best friends on snapchat - Guide
- T-mobile change number - Guide
- Change computer name cmd - Guide
- Change name of lg tv - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Updated on Apr 17, 2018 at 11:54 AM
Updated on Apr 17, 2018 at 11:54 AM
Hi Chris,
Give the following code a try:
When red isn't your color, then have a look at the following link. The table shows you the color index number for the available colors.
https://access-excel.tips/excel-vba-color-code-list/
Best regards,
Trowa
Give the following code a try:
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Columns("I")) Is Nothing Then Exit Sub If Target.Cells.Count > 1 Then Exit Sub Range(Cells(Target.Row, 10), Cells(Target.Row, 60)).Interior.ColorIndex = xlNone If Target.Value = 0 Or Target.Value = vbNullString Then Exit Sub Range(Cells(Target.Row, 10), Cells(Target.Row, 9 + Target.Value)).Interior.ColorIndex = 3 End Sub
When red isn't your color, then have a look at the following link. The table shows you the color index number for the available colors.
https://access-excel.tips/excel-vba-color-code-list/
Best regards,
Trowa
Apr 18, 2018 at 06:36 AM
Apr 19, 2018 at 10:47 AM