Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Software Development
Tag Cloud
access acer asus batch bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory monitor motherboard mouse network operating system printer problem ram registry router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Excel to Word document

Reply  
Thread Tools
Stillasfan's Avatar
Junior Member with 2 posts.
 
Join Date: Apr 2009
Experience: Beginner
27-Apr-2009, 02:20 PM #1
Excel to Word document
I have a non-profit org that requires multiple forms of data and information collection. I am looking for shortcuts to make my life more sane. I have an excel document with a couple hundred lines of data, including client names, addresses, etc. I also have a Word document that requires the data that is contained in the Excel document to be filled into specific places. Can I have excel generate a new Word document form a template using the Excel data? I am using Microsft Office 2007. I would need a seperate document for each line. Thanks for any help anyone can provide.
Bestm8ts's Avatar
Junior Member with 1 posts.
 
Join Date: Apr 2009
27-Apr-2009, 02:28 PM #2
Hey,
I have just the thing!

I am a Macro novice so please don't expect me to be able to explain how this works.

If you create a button and assign this macro to it, when clicking the button it will export everything between two cells into a word document (as an image).

The important bits you've got to worry about are:

Set wd = wdApp.Documents.Open("C:\test.doc") - c:\test.doc is the location of a word document (you have to set this up).

Range("A1:G22").CopyPicture xlScreen, xlPicture - The Range between cells is what is coppied.




Sub PasteToWord()

Dim wdApp As Object
Dim wd As Object

On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0

Set wd = wdApp.Documents.Open("C:\test.doc")

wdApp.Visible = True

Range("A1:G22").CopyPicture xlScreen, xlPicture
wd.Range.Paste

End Sub



Hope this helps!
Stillasfan's Avatar
Junior Member with 2 posts.
 
Join Date: Apr 2009
Experience: Beginner
27-Apr-2009, 02:53 PM #3
Thanks for the info. I very unfamilar with the complex side of excel. How do I create a button? Also, I need the data in each cell to go to a specific place in the template. Will this do that?
Reply

Tags
excel, word

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:01 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.