با سلام
کد ذیل را تست بفرمایید
اگر هر دو سلول E8 و G8 برابر D باشد شرط اول اجرا شده و اگر E8 یرایر D ولی G8 مخالف D باشد شرط دوم اجرا میگردد
کد PHP:
Sub niknam()
Y = ActiveSheet.Cells(5).Column
K = ActiveSheet.Cells(35).Column
For i = Y To K
If Range("E8").Value = "D" And Range("G8").Value = "D" Then
Range("f6").Value = "D"
Range("f7").Value = "E"
Range("h6").Value = "D"
Range("h7").Value = "E"
ElseIf Range("E8").Value = "D" And Range("G8").Value <> "D" Then
Range("f6").Value = "D"
Range("f7").Value = "E"
End If
Next i
End Sub
علاقه مندی ها (Bookmarks)