+ Reply to Thread
Results 1 to 5 of 5

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

  1. #1
    Registered User
    Join Date
    04-19-2010
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    6

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

    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

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Passing values from Excel To Word and reflect values in Word different places of

    Hi,
    You need to use code tags around your code before we can answer you. You also should post a link to your cross-post in MrExcel.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Passing values from Excel To Word and reflect values in Word different places of

    seconding romperstomper's request!

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  4. #4
    Registered User
    Join Date
    04-19-2010
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Passing values from Excel To Word and reflect values in Word different places of

    Quote Originally Posted by teylyn View Post
    seconding romperstomper's request!

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    my apologies..i am in urgency on top of it I am new to forums as well, hope you understand.thanks

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Passing values from Excel To Word and reflect values in Word different places of

    You won't see any answers to your urgent question unless you read and follow our forum rules. It's up to you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1