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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.