Now, insert a rounded rectangle and give the caption as ‘Prepare Marksheet’.
Marksheet sample code#
Please keep the cell reference as it is otherwise your code will not work (if you are following the same example). Save the file with the name ‘ Automating Word from Excel.xlsm’ in the same folder where you have kept Word file.Ĭreate the table with required data as mentioned in below image. Now, open the Excel Application and create a blank worksheet. Once, you create all the Bookmarks save the word file in the name ‘ Marksheet Template.docx‘ at the same location where you are going to keep MS Excel file. We will use these names in VBA code while doing automation. Please use the below mentioned Bookmarks name. In the same way, just create rest of the 16 Bookmarks required for this automation. Let us follow the same step as mentioned above and create bookmark for ‘Name’. This will open the Bookmark dialog box where you can provide the name of bookmark and click on Add button. To create a bookmark in a Word document, place your cursor where you want the bookmark then go to Insert Tab and select Bookmark available under the Links group.
Marksheet sample registration#
In current word file, we need total 17 bookmarks to transfer Student Name, Registration Number, Program Name, Examination Date, Grade, Statistics Marks, Statistics Result, Excel Marks, Excel Result, VBA Marks, VBA Result, SQL Marks, SQL Result, Power BI Mark, Power BI Result, Grand Total Marks and Percentage. Once you create or download the word file, you need to create bookmarks tagging the location where you want your Excel data to be copied. Please create a Word file for Students mark sheet as mentioned in below image or downloadthe template used in this tutorial. If you find that you are constantly copying and pasting data into Microsoft Word in a specific format then you can use the code and logic, which we are going to use here.īefore walking through the macro, it is important to go over a few steps. Creating Student’s Mark Sheet in MS Word from Excel Table. To learn the Word Automation, we will consider a very practical example i.e. In this article, we will learn to automate Microsoft Word from Excel with the help of Visual Basic Language.