'목록하단 광고 치환자(withSeok)

엑사남 11강 Study

엑셀 파일 다운로드

Worksheet_SelectionChange(ByVal Target As Range), Intersect, Is Nothing Then Exit Sub, Target.Count, With Target.Interior, ColorIndex.xlsm
0.02MB

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
                                      '범위로 타겟을 받음.
If Intersect(Target, Range("d2:m21")) _
                        Is Nothing Then Exit Sub
    '교집합이 없으면 Exit sub

If Target.Count > 1 Then Exit Sub
                                      
    With Target.Interior
        '반복되는 구문 with 사용
        If .ColorIndex = 6 Then
            .ColorIndex = 0
        Else
            .ColorIndex = 6
        End If
    End With

End Sub

 

728x90

+ Recent posts