Greetings
I have a table("BloodPressure") containing the following fields:
Date - Systolic Baseline - Systolic Reading - Diastolic Baseline - Diastolic Reading - Pulse Rate
When a date is entered, the Systolic Baseline must automatically have the value 140 inserted as well as
the Diastolic Baseline must automatically have the value 90 inserted.
If date column is empty, then no values are entered in columns Systolic Baseline and Diastolic Baseline.
My code:
Option Explicit
Dim BPrng As Range
Dim iDate As Variant
Dim BL1 As Variant
Dim BL2 As Variant
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set BPrng = Sheet1.Range("BloodPressure")
If iDate <> "" Then
BL1 = 140 And BL2 = 90
Else: BL1 = "" And BL2 = ""
End If
End Sub
I keep getting a Type Mismatch error.
I can get the code to work if I specify the Range cells individually, but unable to create a dynamic function.
Can anyone kindly assist me?
Thanking you kindly
I have a table("BloodPressure") containing the following fields:
Date - Systolic Baseline - Systolic Reading - Diastolic Baseline - Diastolic Reading - Pulse Rate
When a date is entered, the Systolic Baseline must automatically have the value 140 inserted as well as
the Diastolic Baseline must automatically have the value 90 inserted.
If date column is empty, then no values are entered in columns Systolic Baseline and Diastolic Baseline.
My code:
Option Explicit
Dim BPrng As Range
Dim iDate As Variant
Dim BL1 As Variant
Dim BL2 As Variant
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set BPrng = Sheet1.Range("BloodPressure")
If iDate <> "" Then
BL1 = 140 And BL2 = 90
Else: BL1 = "" And BL2 = ""
End If
End Sub
I keep getting a Type Mismatch error.
I can get the code to work if I specify the Range cells individually, but unable to create a dynamic function.
Can anyone kindly assist me?
Thanking you kindly