Excel - FINAL DOCUMENTO

 
Vista:

FINAL DOCUMENTO

Publicado por MACRO EXCEL PARA PASAR A WORD (1 intervención) el 13/03/2021 15:27:12
Hola, intento pasar un texto de excel a word y funciona. Sin embargo, me pasa al principio del documento y no al final. Les agradezco si me colaboran

Esta macro estoy usando

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Sub Copiar()
 
'Abre word prueba
 
If Worksheets("Ficha").Range("F2") = 41792953 Then
Set WordApp = CreateObject("word.Application")
    WordApp.Documents.Open "C:\Users\Laura\Documents\prueba historia.docx"
    WordApp.Visible = True
End If
 
WordApp.Object oConst1 = Word.WdGoToItem.wdGoToLine
WordApp.Object oConst2 = Word.WdGoToDirection.wdGoToLast
WordApp.Selection.GoTo ("ref oConst1,ref oConst2,ref oMissing, ref oMissing")
InsertLines (2)
 
Sheets("Ficha").Select Range("C16").Copy
'Se pegara en el documento lo seleccionado en la hoja de calculo
WordApp.Selection.PasteSpecial_
 
 WordApp.Documents.Save
 
Set WordApp = Nothing
 
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder