View Single Post
 
Old 02-28-2023, 09:27 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Frankly it would make more sense to create the template with the table elements already located and formatted rather than trying to format the document using lots of macro code. I would also recommend the use of ranges to locate the data rather than the selection object which can be a bit hit and miss, leading to the types of error you are encountering when the selection is not where they macro requires it to be.
I suggest that you declare all the variables you use rather than just some of them. It makes the code much easier to follow.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote