Changing colour on changing a Data Validation List with VBA
Dear Forum,
As per the Title, I am Adding Data Validation using a Macro but I want to also change the colour on selecting the Items in the desired column F.
Sub AddDV()
'http://www.excelforum.com/newreply.php?do=newreply&noquote=1&p=2319790
Dim Target As Range
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "D").End(xlUp).Row
End With
For Each cell In Range("C2", Range("C65536").End(xlUp))
'Set target = Range("B1:B3")
Set Target = Range(cell.Offset(0, 3), cell.Offset(LastRow, 3))
With Target.Validation
.Delete
.Add xlValidateList, 1, 1, "Fixed Cost,Variable Cost"
.InCellDropdown = True
.ShowInput = True
End With
Next
End Sub
I am getting 90 filled rows instead of 45 in the column F and 45 in Column G when I am running the same code again for the second column G
I want to add Data Validation Items such as :1 Fixed Cost which should be in the Red Colour i.e. Colour Index = 3
2 Variable Cost which should be in the Blue Colour i.e. Colour Index = - 4165632
The Text should have the below Formatting
Horizontal Alignment= Left
Font = "Book Antiqua"
Font Size = 13
I want to get the colour change immediately on changing the Data Validation...
Warm Regards
e4excel
Bookmarks