Sub 조건부서식테두리그리기()
'
' 조건부서식테두리그리기 매크로
' 셀의 값이 같으면 테두리를 점선으로 그리는 매크로
'
' 바로 가기 키: Ctrl+t
'
    Dim 조건수식 As String
   조건수식 = "=" & ActiveCell.Cells(0, 1).Address(False, True) & "=" & ActiveCell.Address(False, True)
      
    Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
      
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:=조건수식
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Borders(xlTop)
        .LineStyle = xlContinuous
        .TintAndShade = 0
        .Weight = xlHairline
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    
End Sub