Operators\Symbols
Logical Operators
Sub Using_of_and_Operator_with_For_Loop_and_IF()
Dim i As Integer
For i = 2 To 7
If Cells(i, 1).Value > 15 And Cells(i, 1).Value < 20 Then
Cells(i, 2).Value = "True"
Else
Cells(i, 2).Value = "false"
End If
Next
End Sub
Private Sub CommandButton1_Click()
Dim i As Integer
For i = 2 To 6
If Cells(i, 2).Value > 35 And Cells(i, 3).Value > 35 Then
Cells(i, 4).Value = "True"
Else
Cells(i, 4).Value = "false"
End If
Next
End Sub
VBA OR Operator
Private Sub CommandButton1_Click()
Dim i As Integer
For i = 2 To 7
If Cells(i, 1).Value > 15 Or Cells(i, 1).Value < 20 Then
Cells(i, 2).Value = "True"
Else
Cells(i, 2).Value = "false"
End If
Next
End Sub
Copy the code from here:
Private Sub CommandButton1_Click()
Dim i As Integer
For i = 2 To 7
If Cells(i, 2).Value > 35 Or Cells(i, 3).Value > 35 Then
Cells(i, 4).Value = "True"
Else
Cells(i, 4).Value = "false"
End If
Next
End Sub
Is Operator
Private Sub CommandButton1_Click()
MsgBox Range("A1") Is Range("B1")
Range("c1") = Range("A1") Is Range("B1")
End Sub
LIKE Operator
Comparision Operator