Hi KS,
Put this code in your Sheet 1 module and save your book as macro enabled:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim UB As Single, LB As Single, CO As Single, r As Long, m As String
If Target.Address = "$E$2" Or Target.Address = "$I$2" Then
UB = Round(1.1 * Target, 1): LB = Round(0.9 * Target, 1)
Target.Offset(1) = UB: Target.Offset(2) = LB
For r = 2 To Range("A" & Rows.Count).End(xlUp).Row
If Range("A" & r) > LB And Range("A" & r) <= UB Then
CO = Range("A" & r): Exit For: End If: Next r
If CO > Target Then
m = "Your measured value is below " & CO
m = m & " but with uncertainty could be above the " & CO & " cut-off"
Else: m = "Your measured value is above " & CO
m = m & " but with uncertainty could be below the " & CO & " cut-off"
End If
Range("K2") = m: End If: End Sub
Directions for running the routine(s) just supplied
If you haven't used macros before you'll need to go to your options - trust center -trust center settings - macro settings
, the second option down (disable all macros with notification)
Then - Copy the code to the clipboard
Open your Workbook
Press ALT + F11 to open the Visual Basic Editor.
Click on the Sheet 1 module
then paste the code
With the cursor between Sub and End Sub press F5 (F8 to Single Step)
OR
Press ALT + Q to close the code window.
Press ALT + F8 then double click on the macro name
Bookmarks