Private Sub Worksheet_Change(ByVal Target As Range)
Dim x, y As Integer
x = Target.Column
y = Target.Row
If Target.Column = 14 And Target <> "" Then '値が入っているなら
Range(Cells(Target.Row, 8), Cells(Target.Row, 15)).Select
With Selection.Interior
.ColorIndex = 48
.Pattern = xlSolid
End With
Else
Range(Cells(Target.Row, 8), Cells(Target.Row, 15)).Select
With Selection.Interior
.ColorIndex = 0
.Pattern = xlSolid
End With
End If
Cells(y + 1, x).Select
End Sub
仕事に関係する情報のメモ 技術、プロジェクト管理など
0 件のコメント:
コメントを投稿