This reply is about using content controls instead of legacy form fields.
The first step is the same as in the previous reply: Make Word display the Developer tab on the ribbon.
With the cursor in the Retention Time cell, click the Plain Text Content Control button, the second from left in the top row of the Controls group.

That inserts a content control at the cursor position. Click the Properties button when it's enabled, to open this dialog:

Enter a title in the Title box. Unlike the case of the legacy form field, the title isn't required to be a bookmark name, but it's a good idea to make it describe the control's purpose and to keep it short. I recommend checking the box for "Content control cannot be deleted" because you want to make sure the control is available to run the macro. Click OK to save the settings.
Next, insert another plain text content control in the Gradient Used cell, and set its title to Gradient used (or something similar). Also check the "cannot be deleted" box, and click OK.
If you want to change the default placeholder text, click the Design Mode button. The display changes; the blue-outlined boxes at either end show the title, and the placeholder is shaded gray. You can edit the placeholder:

Click the Design Mode button again to return to the normal display.
I'm going to give you a bare-bones macro that just puts the corresponding text in the Gradient control when the cursor leaves the Retention Time control.
With the cursor in your document or template, press Alt+F11 (on some laptops, Alt+Fn+F11) to open the macro editor. You should see a Project pane on the left side; if it isn't there, click View > Project Explorer. This macro must be stored in the ThisDocument module of the document or template:

Double-click that icon to open the large (currently blank) code window on the right. Copy the following code and paste it into the code window, and then save (Ctrl+S).
Option Explicit
Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel As Boolean)
If CC.Title <> "Retention time" Then Exit Sub
Dim strGradient As String
Dim sngRetTime As Single
If CC.ShowingPlaceholderText Or CC.Range.Text = "" Or Not IsNumeric(CC.Range.Text) Then
strGradient = " "
Else
sngRetTime = Val(CC.Range.Text)
Select Case sngRetTime
Case Is <= 0.3
strGradient = "2 - 10 %"
Case 0.3 To 0.4
strGradient = "5 - 10 %"
Case 0.4 To 0.45
strGradient = "5 - 25 %"
Case 0.45 To 0.6
strGradient = "10 - 30 %"
Case 0.6 To 0.7
strGradient = "20 - 40 %"
Case 0.7 To 0.8
strGradient = "25 - 50 %"
Case 0.8 To 1#
strGradient = "30 - 60 %"
Case 1# To 1.2
strGradient = "40 - 80 %"
Case 1.2 To 1.4
strGradient = "50 - 95 %"
Case 1.4 To 1.45
strGradient = "60 - 100 %"
Case 1.45 To 1.5
strGradient = "65 - 100 %" ' what should this be?
Case Else
strGradient = "70 - 100 %"
End Select
End If
ActiveDocument.SelectContentControlsByTitle("Gradient used")(1).Range.Text = strGradient
End Sub
You may need to make a few changes:
- If the title you entered for the retention time content control isn't exactly "Retention time" (including the same capitalization), change the name between the double quotes in the line that starts "If CC.Title" to match the control's title exactly.
- Similarly, if the title of the gradient content control isn't exactly "Gradient used", change the name between the double quotes in the next-to-last line to match the control's title.
- Under "Case 1.45 to 1.5", I've guessed what the gradient expression should be. Change it if necessary.
Here's what the macro does:
Whenever the cursor exits from any content control in the document, Word automatically starts the macro. The items between the parentheses in the Sub line are called "arguments", and Windows fills them with values at the start of the macro. The argument named CC points to the control that the cursor is exiting.
The first If statement says that if the Title of CC isn't "Retention time" (or whatever you changed this to), the macro should do nothing, just immediately stop running.
The two lines that start with "Dim" create storage space for two variables, one a String (a piece of text) and the other a Single (a number that may have decimal places).
The next If statement and the line after it say that if the CC control's placeholder text is showing or if the control is empty, or if it contains text that isn't a number, then the gradient expression will be a space character, nothing else. That way, there's no confusion about some gradient range being displayed when there's no valid retention time value.
If the text in CC passes the validity test, the code in the Else section executes. First it uses the Val function to convert the text string CC.Range.Text into a number, which it stores in the sngRetTime variable. The section that goes from the Select Case statement to the End Select statement figures out which range the sngRetTime value falls into. It tests each Case statement, starting from the top. If the condition isn't met, it goes on to the next Case. When it finds a condition that's True, it executes the statement under it, assigning a value to the strGradient variable, and then jumps to the End Select statement. If none of the preceding cases were True, the Case Else assignment is the final value.
Lastly, the line that starts with ActiveDocument.SelectControlsByTitle locates any controls in the document that have the title shown between quotes. Because more than one control can have the same title, the result is a collection of zero or more controls, and the (1) selects the first one in the collection. (Normally you'd have to test whether there's at least one control in the collection, to avoid a runtime error if there are zero in the collection. Because the gradient control in the document or template should have the "cannot be deleted" box checked, that one should always be present. If you see the error "The requested member of the collection does not exist", the problem is probably that the macro doesn't exactly match the control's title, such as a different capitalization.) The Range.Text of that control is set to whatever text is in the strGradient variable.