katenguyen
New Member
- Joined
- Apr 12, 2023
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
Hi,
I'm wonder if there is any way to code that After copy a cell value, then paste to Word and then enter the line and paste the next one? (can it be a loop?)
My code right now is this. The <A1> in Word is formatted in numbering so when it pastes the value picked up from Excel, it will auto-numbered.
But sometime, the value is included multiple lines so it auto enters the line..
I'm wonder if there is any way to code that After copy a cell value, then paste to Word and then enter the line and paste the next one? (can it be a loop?)
My code right now is this. The <A1> in Word is formatted in numbering so when it pastes the value picked up from Excel, it will auto-numbered.
But sometime, the value is included multiple lines so it auto enters the line..
VBA Code:
Sheets("TOTAL").Range("AC3:AC8").Select
Selection.SpecialCells(xlCellTypeVisible).Copy
With WordApp
.Application.Selection.Find.Text = "<A1>"
.Application.Selection.Find.Execute
.Application.Selection.PasteAndFormat wdFormatPlainText
End With