ACCESS VBA で EXCEL のセル背景色を設定

With wksTarget

Select Case rst.Fields(“休日種別”).Value

Case “法定休日”
.Range(.Cells(k, 1), .Cells(k, 12)).Interior.Color = RGB(245, 245, 245)

Case “法定外休日”
.Range(.Cells(k, 1), .Cells(k, 12)).Interior.Color = RGB(255, 228, 225)

Case “振替休日”, “代休”, “自己都合”, “会社都合”
.Cells(k, 2).Interior.Color = RGB(255, 255, 101)
.Cells(k, 2).Font.Color = RGB(255, 0, 0)

Case “有給”
.Cells(k, 2).Interior.Color = RGB(204, 255, 153)

End Select

End With