Thread: [Solved] VBA Run Time Error 91
View Single Post
 
Old 09-26-2024, 03:23 AM
Shelley Lou Shelley Lou is offline Windows 10 Office 2016
Expert
 
Join Date: Dec 2020
Posts: 259
Shelley Lou is on a distinguished road
Default VBA Run Time Error 91

Hi Vivka, the code should only run on text that is selected i.e. text selected directly after the table at clause 1.1 and before schedule 1, hopefully the way the code is written it should only work on selected text and nothing else in the document (the test document is how our leases are set up with tables and just for info purposes).

The idea was I was hoping the code only worked on selected text, if I copy and paste the text into a blank document (i.e. with no tables etc.) it does work, so I've gone back to that way to use the code and then once updated I copy it back into the lease document. Bit long winded but its how it will only work at the moment.

Unfortunately when running your new code it ended up in an endless loop and I had to shut Word down.

Thanks so much for all the help though, I really do appreciate it.
Reply With Quote