Exporting from Excel to Word

sverker123

New Member
Joined
Aug 1, 2017
Messages
1
Hi there,

I'm new to VBA and I have find myself stuck with trying to export data from Excel to Word using VBA.

Basically, what I need is a piece of code that opens Word, copies a dynamic range in my sheet (which I have defined):

.Range("A12:J" & Range("A65536").End(xlUp).Row)

Then, the copied section would then be pasted into the Word document, and lastly the word-document would be saved and the name of the file would be Report_X - with X being the value of cell H12.

Also, the only formatting that seems to work is if the content is pasted into a word-document that is in A3. Is that possible to do?

I would really really appreciate some help as I can't seem to find anything about how this could be done.

Many thanks!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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