Copying from excel cell to specific Word

klutch

New Member
Joined
Jun 7, 2018
Messages
38
Hello, I am trying to copy a cell from excel into a specific line within a file I open with my code.
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
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?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

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