Posts

Showing posts from August, 2018

VBA Code to copy and paste the Content from excel to word

Image
There are situations where you may have to copy and paste some content from excel to word. And save the newly created document into disk. The below VBA code or a macro will help you to do that. It is a very simple code, it is being executed from MS Excel. The MS Word object Library should included. This library has to functionality to interact with MS word object.  To include MS word object library, go to Tools and then select References. Select the required object library as shown in the picture below.   To copy the VBA code follow the below steps Open excel and make your table ready. This steps is as per your requirement.  Press Ctrl + F11, this will open a Visual Basic editor.  Click on insert and then module.  Module1 will appear if do not have any  module. Paste the below code into this module  Go back to excel and your macro will appear under macros list. Select and click on Run to execute the macro.  Watch...