This is my third day of using VBA. I am currently working a 3 month contract for this company and have figured out how to automatically transfer data from excel to a new word document (a process they have wanted for years). I also found out how to open an existing word document from excel.
The thing is, I haven't worked out how to transfer data from excel to an existing word document.
Below is the code I am trying to write for the above reason. Can anyone point out where I'm going wrong? Any and all answers would be greatly appreciated :)
Sub CopyRangeToWord()
Dim objWord As Word.Application
Dim objDoc As Word.Document
Set wordApp = GetObject("C:\Users\CoffeeFuelsMeNow\Documents\Ladedadeda\Testplate.dotx")
Set objDoc = objWord.Documents
objWord.Visible = True
Range("A1:B10").Copy
With objDoc.Paragraphs(objDoc.Paragraphs.Count).Range
'All formatting goes here
.Paste
.Font.Name = "broadway"
.Font.Color = wdColorBlue
.Font.Bold = True
.Font.Italic = True
.Font.Allcaps = True
.Font.Size = 20
End With
End Sub