VBA CopyRange selection into Word document

gerv19

New Member
Joined
May 16, 2017
Messages
3
I have managed to come up with the following code to highlight a range of cells of a table in excel that I need to post into a word document. I need help actually getting my "copyrange" selection into the word document.

Any ideas?

Sub Macro04()

Dim wApp As Word.Application
Dim wDoc As Word.Document
Set wApp = CreateObject("Word.Application")
wApp.Visible = True
wApp.Documents.Add

Dim Copyrange As String
Startrow = 3
Lastrow = 18
Let Copyrange = "A" & Startrow & ":" & "P" & Lastrow
Range(Copyrange).Select

wApp.Selection.Paste
wApp.ActiveDocument.SaveAs Filename:="firstdocument.doc"
wApp.ActiveDocument.Close

End Sub
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Watch MrExcel Video

Forum statistics

Threads
1,108,719
Messages
5,524,459
Members
409,582
Latest member
riibuildersinc

This Week's Hot Topics

Top