Pasting text from Excel to Word (macro)

Cello

New Member
Joined
Jan 7, 2005
Messages
17
Hi,

I've asked this once before but no replies, forgive me for trying again.

I'm trying to paste text from Excel to Word. I cannot get it to work
right - everything is pasted on line 1 in Word. The previously pasted text
gets replaces by the later pasted text. The later text should of course be
pasted on line 2 etc. Can anyone help me out here?

Here's the macro I've been trying to use:

Sub TW()

Dim AppWD As Word.Application
Dim DocWD As Word.Document
Dim RangeWD As Word.Range

Set AppWD = CreateObject("Word.Application.11")
AppWD.Visible = True

Set DocWD = AppWD.Documents.Add
With DocWD
Set RangeWD = .Range
Sheets("T").Select
Range("A15").Select
Selection.Copy
With RangeWD
.Font.Name = "Arial"
.PasteSpecial DataType:=wdPasteText, Placement:=wdInLine
.InsertParagraphAfter
.Collapse wdCollapseEnd
.InsertParagraphAfter
End With
Set RangeWD = .Range
Sheets("T").Select
Range("A17").Select
Selection.Copy
With RangeWD
.Font.Name = "Arial"
.PasteSpecial DataType:=wdPasteText, Placement:=wdInLine
.InsertParagraphAfter
'.InsertParagraphAfter
.Collapse wdCollapseEnd
.InsertParagraphAfter
End With

End With

Sheets("S").Activate

End Sub
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,215,044
Messages
6,122,827
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top