Excel VBA添加数据validation背景颜色两个单独的单元格

如果用户在工作表mySheet.Cells(row, 3).更改数据validationmySheet.Cells(row, 3).

从mySheet中摘录

要求是程序更新相同的背景颜色即时不同的工作表,如mySecondSheet.Cells(row, 2).

在这里输入图像说明

我必须在我的代码中添加什么?

 Public Function addDataValidation(row As Long) Dim optionList(2) As String optionList(0) = "1" optionList(1) = "2" optionList(2) = "3" With mySheet.Cells(row, 3).Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=Join(optionList, ",") End With With mySheet.Cells(row, 3).FormatConditions.Add(xlCellValue, xlEqual, "=1") .Font.Bold = True .Interior.ColorIndex = 4 .StopIfTrue = False End With With mySheet.Cells(row, 3).FormatConditions.Add(xlCellValue, xlEqual, "=2") .Font.Bold = True .Interior.ColorIndex = 6 .StopIfTrue = False End With With mySheet.Cells(row, 3).FormatConditions.Add(xlCellValue, xlEqual, "=3") .Font.Bold = True .Interior.ColorIndex = 3 .StopIfTrue = False End With With mySheet.Cells(row, 3) .HorizontalAlignment = xlCenter .Value = optionList(0) End With End Function