How can we help?
Search for answers or browse our knowledge base
Conditional Lock
The conditional lock allows you to restrict input in a range of cells while disabling mandatory constraints of included components. The video below provides a detailed presentation of the feature.
The conditional lock works on a principle similar to conditioning: a formula defines the locking activation condition and the application range.
Syntax
GTLOCK(range;formula;[Drag_Formula])
- range: the range of cells to be locked.
- formula: the formula to be evaluated. If the formula returns TRUE, then the range is locked.
- Drag_Formula: allows specifying whether the formula is adapted (shifted) for each cell of the starting range; should be specified as TRUE when the locked area is a range. Defaults to FALSE.
Points to note
- The range must be on the same sheet as the GTLOCK function.
- For each cell in a sheet, only one GTLOCK declaration is allowed.
- Declared mandatory components that are locked are no longer considered mandatory when transmitting the response.
- However, GTConstraint constraints must be checked even if the component is locked.
- It is recommended to disable Excel import for documents using GTLOCK. Indeed, during an import, you cannot guarantee the order in which data is imported, so there is a risk that components receive values during the import before the data necessary for the formula calculation is imported.
Examples
Example 1 =GTLOCK(A1;B1>0)
The component located in A1 will be locked if B1>0.
Example 2 =GTLOCK(A1:A3;B1>0;TRUE)
The component located in A1 will be locked if B1>0, the component in A2 will be locked if B2>0, etc…
Example 3 (not recommended) =GTLOCK(A1:A3;B1>0)
The components located in A1, A2, and A3 will be locked if B1>0, Equivalent expression to =GTLOCK(A1:A3;$B$1>0;TRUE)
You can also download the file used in the video.