I am trying to export cells from Excel file into new Word file and then format the document with the use of VBA. Until now I have simple code:
Sub Macro1()
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("abc")
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Documents.Open "C:\Users\xxx\test.docx"
With objWord.ActiveDocument
Range("A2:B2").Select
Selection.Copy
'here I have problems
End With
End Sub
My problem is to paste selected cells into the Word document and format them. What should I type below Selection.Copy
?