Export to word 1row & range

beczer

New Member
Joined
Nov 21, 2016
Messages
49
Hi

I have a problem with below code. As you see it takes only 1 rows but I would like to add range to this code as it is below. It doesn't work but I hope to find support here.

I paste only part of my code because I think that there is a mistake in this part.

Thank you

Code:
Set wApp = New Word.ApplicationwApp.Visible = False


With ActiveWorkbook.Sheets("List")
       
    For lRow = 3 To .Range("C" & .Rows.Count).End(xlUp).Row
        NAME = .Cells(lRow, "C")
        ADDRESS = getAddress(lRow)
        ADDRESS2 = getAddress2(lRow)
        ID = .Cells(lRow, "B")
        Title = .Cells(lRow, "G")
        NAME = .Cells(lRow, "H")
        Sum = .Cells(lRow, "I")
        Sum2 = .Cells(lRow, "J")
        Date2 = .Cells(lRow, "K")
        [B]test = .Range("W3:W5")
[/B]
exportToWord1 ID, NAME, ADDRESS, ADDRESS2, Title, NAME, Suml, Sum2, Date2, test, FPATH
        
    Next lRow
End With
wApp.Quit
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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