In this article, you will learn the simple steps to write to a Word File using Macros (VBA) in Excel Office 365. Let’s get them below!! Get an official version of MS Excel from the following link: https://www.microsoft.com/en-in/microsoft-365/excel
The Process Of Writing To A Word File Using Excel VBA
- Firstly, in the Excel Worksheet, you have to go to the Developer Tab.
- Then, you need to select the Visual Basic option under the Code section.

- Now, you have to copy and paste the code given below.
Sub WriteToWord()
''Using Early Binding
'Dim wordApp As Word.Application
'Dim mydoc As Word.Document
'set wordApp=new word.Application
'Using late binding to create word application object
'Declaring variables as objects
Dim wordApp As Object
Dim mydoc As Object
'Initializing the object using CreateOBject Function
Set wordApp = CreateObject("Word.Application")
'Making word App Visible
wordApp.Visible = True
'Creating a new document
Set mydoc = wordApp.Documents.Add()
'Getting input from user
myString = Application.InputBox("Write Your Text")
'Writing to word
wordApp.Selection.TypeText Text:=myString
'inserting a new paragraph
wordApp.Selection.TypeParagraph
End Sub
- After that, you need to save the code by selecting it and then close the window.

- Again, you have to go to the Excel Spreadsheet , and click on the Developer Tab.
- You need to choose the Macros option in the Code section.

- Then, you have to make sure that your macro name is selected and click the Run button.

- Now, you will receive an input dialog box, and then you need to type any text in the text box.

- Finally, you will receive your input text in the Word document.

Check this too:
Verdict
In the above article, you can learn the simple steps to write to a Word File using Macros (VBA) in Excel Office 365. Kindly, share your feedback in the below comment section. Thanks for visiting Geek Excel. Keep Learning!
Read Also:
- How to Change Font Color in Microsoft Excel 2007?
- Excel Formulas to Count specific word in a range ~ Easy Tutorial!!
- Excel Formulas to Get the Last Word of a Text String ~ Quick Method!!
- Count the Times a Word Appears in a Cell or a Range in Excel Office 365!!
- Excel Formulas to Remove the Last Word ~ Easy Tutorial!!
Top comments (0)