VBA Error 13 type: mismatch
问题 I am not very familiar with VBA but needed to change my excel to allow more than 3 conditional formattings. I found the below code online and want to change the colour of the cell depending on the content with a choice of six different values. My code is: Private Sub Worksheet_Change(ByVal Target As Range) Set MyPlage = Range("G3:AG115") For Each Cell In MyPlage If Cell.Value = "." Then Cell.Interior.ColorIndex=28 Cell.Font.Bold = True End If If Cell.Value = "X1" Then Cell.Interior.ColorIndex