rhombus4
Well-known Member
- Joined
- May 26, 2010
- Messages
- 586
- Office Version
- 365
- 2016
- Platform
- Windows
Hi,
Need to copy Range from excel and paste into a word document. will probably have to copy 2 or 3 ranges so may have to repeat the process
Need to copy Range from excel and paste into a word document. will probably have to copy 2 or 3 ranges so may have to repeat the process
Code:
Sub CopyRange()
Range ("MyDatatoCopy")
Dim wrdApp, wrdDoc
Set wrdApp = CreateObject("Word.Application")
Set wrdDoc = wrdApp.documents.Open("C:\MyDocs\Test\Myworddoc.docx", ReadOnly:=True)
wrdApp.Visible = True
Selection.Goto What:=wdGoToBookmark, Name:="Bookmark1"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = True
End With
Selection.Paste
End Sub