HOW TO
Run a Click Driven Script
Goal
Trigger a controlled multi-step workflow from a worksheet click.
Prerequisites
- Runline U Add-in installed in Excel.
- A worksheet range that lists the script steps.
- A visible trigger cell, button-like cell, or click range.
Steps
1. Define the Trigger Cell
Use U.SET_CLICKVALS to make the cell write a recognizable trigger value.
2. Create the Script
Use U.CREATE_SCRIPT to define the ordered steps and an optional log range.
Historical examples use simple steps: clear old output, iterate through input rows, paste intermediate values, and append completed rows to a result area.
3. Run Only When Triggered
Use U.GET_CLICKVAL, U.EVENT, or a visible trigger cell so normal recalculation does not repeatedly run the script.
4. Keep Output and Logs Separate
Clear or paste output ranges explicitly. Keep a log range visible so the user can inspect which step ran last.
Result
The workbook can run a repeatable action sequence from a click while keeping the trigger, steps, and log auditable.
Common Variations
- Use
U.NOWas a delayed or periodic trigger. - Use
U.PASTEto write each step result into a staging range. - Use
U.CLEARbefore starting a fresh run. - Use
U.FORMAT_STRINGto build parameterized step expressions.
Troubleshooting
- If the script runs more than once, isolate the trigger formula from volatile recalculation.
- If a later step runs before data is ready, add an explicit readiness check before that step.
- If users cannot diagnose failure, add or expand the script log range.