gumstic
New Member
- Joined
- Mar 8, 2020
- Messages
- 1
- Office Version
- 2016
- 2010
- Platform
- Windows
- Mobile
- Web
Hi
I'm trying to copy an excel sheet over to a Word document via VBA.
I managed to get it all done but ALL sheets tag along.
Any advice how I can copy ONLY the selected worksheet without others tagging along?
Thank you,
Andreas
I'm trying to copy an excel sheet over to a Word document via VBA.
I managed to get it all done but ALL sheets tag along.
VBA Code:
Sub PasteToWord()
Dim appWord As Word.Application
Set appWord = CreateObject("Word.Application")
appWord.Visible = True
' Change the range to suit your needs. See the How to Use for this code
Worksheets("Spectrum1").Range("A1:J44").Copy
appWord.Documents.Add
appWord.Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, _
Placement:=wdInLine, _
DisplayAsIcon:=False
Application.CutCopyMode = False
Set appWord = Nothing
End Sub
Any advice how I can copy ONLY the selected worksheet without others tagging along?
Thank you,
Andreas