Zoho Sheet · Automation and productivity · Intermediate
Record, inspect and run a small VBA macro
Record one harmless formatting action with fixed references, inspect the generated VBA, and replay it only on a disposable practice range.
Quick answer
Record one harmless formatting action with fixed references, inspect the generated VBA, and replay it only on a disposable practice range.
Before you start
Zoho Sheet web editor in an English desktop browser; rolling service, official documentation reviewed 20 October 2026. Not desktop-app or mobile instructions. Use an editable practice file containing only synthetic data. Keep the original unchanged and record the file name and storage location so that you reopen the same copy. These are documentation-based instructions and independently checked examples, not a claim of native application testing.
Prepare a visible, reversible task
In a private workbook, use a worksheet named Sheet1. Enter Item, Units and Status in A1:C1, followed by two synthetic records: Blue, 12, Ready; and Green, 8, Review. Leave E1:G3 empty as a control area.
The task is to format A1:C1 in bold, not to send messages, delete data or change permissions. Record the original appearance and keep a copy before running any macro. A macro can do more than formatting, so a trusted-looking name is not evidence that its code is safe.
Record the header action
- Choose Tools → VBA Macros → Record Macro.
- Name it
FormatPracticeHeader. Add a clear description if the dialog offers one. - Leave Use Relative Reference unchecked for this fixed-range exercise. The intent is always to affect A1:C1, not a range offset from whichever cell happens to be active.
- Start recording. Select A1:C1 and apply bold using the normal formatting control.
- Stop recording immediately. Use View Code to inspect the captured macro in the VBA editor.
Look for the worksheet and range references and the formatting operation. The recorder may include selection actions as well as the actual format change; generated code is not promised to be identical across service revisions. Do not paste a guessed transcript of recorder output into the file and call it a recording.
Inspect before running
Confirm there are no unexpected operations such as email routing, external URLs, row deletion or workbook events. Check the target really is the intended header. Zoho’s macro guide includes examples that send email and run on workbook events; those are not needed here and should not be added to a simple formatting exercise.
If the generated code is unclear, do not run it in a business workbook. Keep the practice copy and obtain an explanation of the exact statements first. A macro’s successful compilation does not show that it changes the right cells.
Replay and compare
Return A1:C1 to its unbolded starting appearance manually. Select E1 as a deliberate challenge to the reference mode. Open the macro list, documented by Alt+F8, choose FormatPracticeHeader and run it.
A1:C1 should become bold while E1:G3 remains unchanged. If the action moves with the active cell, inspect relative-reference recording or recreate the macro with the fixed-reference intent. If the operation toggles rather than sets bold, restore the starting state before each replay and document that behavior; do not assume running it twice is harmless.
The underlying data must still be Blue 12 and Green 8, with total units 20. Formatting success alone does not prove data preservation.
Maintain a small automation safely
Record the macro’s purpose, target range, required starting state and expected visible effect beside the practice data. Test again after renaming the worksheet or changing the header layout in a copy, since hardcoded references may no longer point where you intend.
Keep the macro-bearing workbook separate from a static export. Do not assume every Excel VBA library, local file operation or exported macro format is supported by Zoho Sheet. Reopen the saved cloud workbook and inspect the macro list and target range; verify any exported version separately before relying on it.
Related tutorial
Continue with cell formatting basics.
Official sources
Documentation reviewed 20 October 2026.