Sub 条件付き書式_自動セット(a As Boolean)
'シート「リスト」のC列の値と同じ値が見つかった場合、そのC列の背景色を条件式に登録する
YY = 2
CL = 0
Columns("H:H").Select
Do While Sheets("リスト").Cells(YY, 3) <> ""
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=" & Chr(34) & Sheets("リスト").Cells(YY, 3) & Chr(34)
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).Interior.Color = Sheets("リスト").Cells(YY, 3).Interior.Color
Selection.FormatConditions(1).StopIfTrue = False
'Exit Do
YY = YY + 1
Loop
End Sub