Application.OnRepeat

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


Excel

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", _
                        Procedure:="PasteIncrement"
End Sub

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


Word

This method does not exist in Word at the moment.


PowerPoint

This method does not exist in PowerPoint at the moment.


© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

PrevNext