This event runs when the user chooses (Edit > Repeat) after running a macro.

Application.OnRepeat(Text, Procedure) 

You can use the OnRepeat method of the application object to customise the functionality of the Repeat command


Lets suppose you want to paste a date into a cell and you want to increment this date by one day for each successive paste from the cell above the active cell

Public Sub DefineRepeat 
   Application.OnRepeat Text:="Paste Next Date", _
End Sub

Public Sub PasteIncrement
   ActiveCell.Value = ActiveCell.Offset(1,0).Value + 1
End Sub


The method Application.OnRepeat does not exist in Word at the moment.


The method Application.OnRepeat does not exist in PowerPoint at the moment.

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext