excel vba if and multiple conditions code example
Example 1: vba if and
If LWebsite = "TechOnTheNet.com" And LPages <= 10 Then
LBandwidth = "Low"
Else
LBandwidth = "High"
End If
Example 2: how to use if condition in time vba
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B:B")) Is Nothing Then
Range("D" & Target.Row) = Date
Range("E" & Target.Row) = Format(Now, "hh:mm:ss")
End If
End Sub