Snap points to END of event?

This is My new favourite Macro… Just what I needed. Shame when we change the BPM, cubase locks the front of the part to the grid, instead of the Snap Point.