View Single Post
 
Old 05-18-2015, 10:58 PM
Dave T Dave T is offline Windows 7 64bit Office 2007
Advanced Beginner
 
Join Date: Nov 2014
Location: Australia
Posts: 66
Dave T is on a distinguished road
Default Find last word in paragraph and delete it

Hello All,

I do not know how to do this so I am after some help…

I am after a macro that will:
  • Go to the end of the current paragraph (not line) the cursor is in
  • Find the last space in the paragraph (i.e. go back from the paragraph mark to the first space left)
  • Select the whole last word (including any full stop, etc.) and delete it

For example:
The quick brown fox.
The macro would delete the word fox including the full stop.
I am not fussed if it also deletes the space (leaving 'brown' without any space after it).

Any help appreciated.

Regards,
Dave T
Reply With Quote