Passing values from Excel To Word and reflect values in Word different places of page/pages

csekhar.apps

New Member
Joined
Apr 19, 2010
Messages
5
Hi All,

Thanks in advance,I'm a complete newbie when it comes to VBA programming, Excel and Word other than the most basic of use.

I have a word document which I would like to automatically populate data from Excel into. The word document is a template and I would rather the data from excel didn't just appear in a line but rather in the various places on the page and different pages it should go.

For instance

------A---------B---------------C--------D-----------E----------F
first page
1----Fred------01-Jan-2010------San Jose,CA-----Left-----------£55.55-----YES

second page

2----John------01-Jan-2010------San Jose,CA-----Available------£99.99-----YES

To appear as

Account Name - Fred (A1)

Due Date - 01-Jan-2010 (B1)

Address- San Jose,CA (C1)

Status - Left (D1)



I would like to extract the data from A1, B1 and D1 into word document in page1.

Then other values extract from A2, B2 and D2 into another page2.

Ideally I would like to add a button by the clicking of this button the word document is created. The button should self populate values
in Word document in different places on different pages.Hope I am not confusing in my requirement

If I'm asking too much then please tell me, if the facility to do this is too difficult equally let me know.

I've viewed the code that others have posted which simply copy the data from excel to word this doesn't really suit my requirements.in fact this is my code and where i stuck

Sub PasteToWord()

Dim AppWord As Word.Application

Set AppWord = CreateObject("Word.Application")
AppWord.Visible = True
' Change the range to suit your needs. See the How to Use for this code
Sheets("Sheet1").Range("A1:C10").Copy
AppWord.Documents.Add
AppWord.Selection.Paste

Application.CutCopyMode = False

Set AppWord = Nothing

End Sub

Sub CellsExample()
For i = 1 To 25
For j = 1 To 10
Cells(i, j) = "Rows " & i & " Cols " & j
Next j
Next i
End Sub

Thanks once again
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,172,238
Messages
5,879,866
Members
433,461
Latest member
Confusedexcelhelp

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
Top