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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,214,932
Messages
6,122,334
Members
449,077
Latest member
Jocksteriom

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