Name

Application.OnRepeat(Text, Procedure)

Synopsis

Reassigns the Repeat item on the Edit menu (Ctrl-Y).

Argument

Setting

Text

The text to display instead of Repeat...

Procedure

The procedure to run when the user chooses Edit → Repeat or presses Ctrl-Y.

The following code replaces the Repeat item on the Edit menu with the item Do Over and runs the DoOver procedure with the user selects the item:

Sub TestOnRepeat(  )
    Application.OnRepeat "Do over", "DoOver"
End Sub

Get Programming Excel with VBA and .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.