Table of Contents

If...End If

Excel

If Target = Worksheets("Sheet 1").Range("C2") Then
' do something
End If

Access

Private Sub UpdateAgeNow()
    If IsNull(tbDate.Value) Then
        tbAgeNow.Value = 0
    Else
        Dim ageNow As Double
        ageNow = dateDiff("d", tbDate.Value, Now) / 365
 
        tbAgeNow.Value = Round(ageNow, 2)
    End If
End Sub