Hi macropod
Thank you for your time in going through the sub, finding the unnecessary code and the suggestions for better efficiency. You also suggested a stand alone sub that transfers the data to the bookmark instead of a paste.
I have update my sub with your suggestions, and all is fine. I tried to utilize the UpdateBookMark sub and got errors due to mismatched data types. Finally got it to transfer but problems still endured. The data was not formatted as I wanted and it was placed before the bookmark. This was my initial problem with the pastespecial code I started with. What I am trying to do is transfer the data from several cells, as is formatted to a bookmark in word, replacing the data in the bookmark and keeping the bookmark. There is a sub I use in my ExportToWord code called WB and it is basically the same as your standalone and it works great but anytime it is used it is a single text entry. I am aware that you stated selection and paste is not the way to do it but initially (given the bookmark is empty) it does what I want to do. The help I am looking for is either.
Remove the paste that was done BEFORE the bookmark, allowing the current pastespecial to be done in its place OR preferably I would like to have it inside the wordwrapped bookmark, replacing anything currently in there.. In addition to the previous changes, I have set Options.ReplaceSelection = True.
I would like to thank you for your patience, the help you have given and any further assistance!
|