2개의 셀에 특정 값이 포함되어 있는지 여부에 따라 셀을 자동으로 채운 다음 자동 실행해야 합니다. 이것이 내가 지금까지 가지고 있는 것입니다:
Private Sub Worksheet_Change(ByVal Target As Range)
If target.Cells(5, "B").Value = "Secured" And target.Cells(6, "B").Value = "Amendment" Then
Cells(10, "B") = "T2 - Medium Risk"
End If
End Sub
if 문은 =IF(AND(D34="Secured",D35="Amendment"),"yes","")
"예"가 다른 셀에 있어야 합니다.
답변1
이것이 당신이 찾고 있는 것입니다
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B5:B6")) Is Nothing Then
If Cells(5, 2) = "Secured" And Cells(6, 2) = "Amendment" Then
Cells(10, 2) = "T2 - Medium Risk"
End If
End If
End Sub
변경 사항이 해당 두 셀 내에 있을 때 실행되고 일치하는 경우 다른 셀을 채우기를 원합니다. 지우고 싶다면 그렇게 할 수도 있습니다.