Skip to content
REFERENCE

U.CLEAR

Summary

Clears the specified range and returns the values that were removed

Syntax

=U.CLEAR(range, [return_val], [return_val_is_backup], [block])

Parameters

Parameter Required Description
range Yes The ranges to be cleared
[return_val] No If provided and range is not already empty, then these are the return values instead of the values cleared from range. If set to "clear_images()" (or any of a multi-page input set to "clear_images()") then any images overlapping the specified range(s) will be removed. Use "clear_images(true)" to remove both images and data from the range(s)
[return_val_is_backup] No If set to TRUE, then specified return_val is returned only if range was already empty If set to FALSE, then a specified return_val is returned in all cases If set to a number, values from that range are returned if any existed else any return_val if provided
[block] No If set to TRUE then method will not be calculated unless triggered by user interaction or calculated as a step in a script; If set to a number then will be throttled to not calculate more frequently than the specified number of seconds; make number negative to prevent auto recalc of blocked methods

Behavior

The documented public interface is supported by the current U Add-in source signature and the maintained Usage Examples workbook. Optional parameters are shown in square brackets in the syntax above; omit the brackets when entering a formula.

Return Value

Returns the function result or action status described by the formula and parameters above. The maintained sources do not define a narrower, stable return contract for this function.

Examples

=IF(B5="","Waiting",U.PASTE(U.VAPPEND(U.CLEAR(B5),U.REGION(B8)),B8))
=U.CLEAR(E7:E9)
=U.CLEAR((G11:H19,J11),"Cleared")

Notes

  • Formula examples are preserved from maintained workbook usage and normalized to the current U. prefix.
  • Complete formulas demonstrate working patterns; they do not imply that undocumented option values are supported.
  • Where maintained sources do not specify every accepted value, default, or error message, this page does not infer one.
  • For functions that perform actions, use a visible trigger or supported block/throttle parameter to avoid unintended repetition during recalculation.