Hello, I am trying to copy a cell from excel into a specific line within a file I open with my code.
as you can see, my code stops after I select the cell I wish to copy. I am not sure of the code to select the word doc I previously opened and then paste it.
I am trying to paste it in the 3rd section of a table on line 10 of page 5.
Is anyone familiar with this?
Code:
Sub CopyandPaste()
Dim myfile
myfile = Application.GetOpenFilename(, , "Browse for Document")
Dim wdapp As Word.Application
Set wdapp = CreateObject("Word.Application")
wdapp.Visible = True
Dim wddoc As Word.document
Set wddoc = wdapp.Documents.Open(myfile)
If Range("L2") <= 30 And Range("L2") >= 20 Then Range("j2").Copy Range("s2")
If Range("L2") <= 19 And Range("L2") >= 0 Then Range("J2").Copy Range("s2")
If Range("L2") <= -1 And Range("L2") >= -30 Then Range("j2").Copy Range("s2")
Range("s2").Select
Selection.Copy
End Sub
I am trying to paste it in the 3rd section of a table on line 10 of page 5.
Is anyone familiar with this?