Skip to content
REFERENCE

U.SET_CLICKVALS

Summary

Registers a range of data where, when a cell within that range is clicked, subscribers will update with the indicated value

Syntax

=U.SET_CLICKVALS(name, click_range, [row_shift], [column_shift], [values_or_start_val], [default_or_increment], [has_range_refs], [click_config], [target_range])

Parameters

Parameter Required Description
name Yes The name under which to register the range; prefix with [GLOBAL] to make visible to all workbooks in instance. If two names are provided in a 2-column row, the first will be the name used to register the click range and the 2nd will be returned by the method and so displayed in the cell
click_range Yes Up to 3 ranges (increment, decrement, reset) to be registered under the specified name. When a cell in a range is clicked subscribers receive an updated value. If "self" is hard-coded as the value then the click range is the calling range. Use "image()" for clickable image. If no range is provided then the specified name will be unregistered. Use "none()" to indicate no click ranges but keep registered
[row_shift] No The number of rows to shift the curser after a cell in range is clicked. Or if set to range ID(s) as returned by U.RANGE_REF then that range is selected after a cell in range is clicked. By default the cursor remains on the clicked cell
[column_shift] No The number of columns to shift the curser after a cell in range is clicked. Or if row_shift is set to range ID(s) then set to TRUE or FALSE to indicate whether to scroll to selected cell; pass 2 values (e.g.: {TRUE, FALSE}) to set scroll row and scroll column independently; pass integers instead of booleans to indicate scroll offsets. By default the cursor remains on the clicked cell
[values OR start_val] No If set to a range of values then update value will cycle through values with each click of a cell in the click range (cycle backwards if decrement range is clicked). If set to a number then value will increment (or decrement) with each click range click. "return(row/col)" returns index
[default OR increment] No If values_or_start_val is a range of values then sets the default value If values_or_start_val is a number then sets the increment applied with each click range click
[has_range_refs] No If set to TRUE then click ranges will be checked to see if they contain range refs created by U.RANGE_REF and if so will treat the referred range as the click range. If ALL then each cell is checked for range refs. Provide 2nd value in row vector to apply to target_range separately
[click_config] No Set to a row vector of up to 3 TRUE/FALSE values to indicate whether to ignore right-clicks, prevent automatic post-click recalcs when Excel is in manual mode, and/or treat a selection change in the click range as a click, respectively. If any value is "image" then buttons are images in ranges. If set to "hover" then triggering event is a cursor over the click range rather than a click
[target_range] No If set to a range of cells, then any cell clicked in that range will have its value updated to the most recent value of the clickval range. In special case of return(calc), if this parameter is set it will be the range calculated instead of the click range

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

=U.SET_CLICKVALS("methods_nav",B4:B217,AA4:AA189,{-1,FALSE})
=U.SET_CLICKVALS("params_nav",D4:D217,AD4:AD189,{TRUE,FALSE})
=U.SET_CLICKVALS("back_nav",AH5:AH189,U.RANGE_REF($A$1),,,,"ALL")

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.