Application OnKey Method

Purpose

This method runs a specified procedure when a particular key or key combination is pressed.

Syntax

OnKey(Key, Procedure)

Required Parameters

Key

A string indicating the key to be pressed.

Optional Parameters

Procedure

A string indicating the name of the procedure to be run. If Procedure is "" (empty text), nothing happens when Key is pressed. This form of OnKey changes the normal result of keystrokes in Microsoft Excel. If Procedure is omitted, Key reverts to its normal result in Microsoft Excel, and any special key assignments made with previous OnKey methods are cleared.