PDA

View Full Version : Using vba to automate a Microsoft Word document with data imported from a Excel sheet



dinocore
01-30-2016, 05:39 PM
Hi, I'm hoping I can get a little help. Like the title says, I'm trying to populate a Word document with information from Excel. The table on excel looks really simple.
QUESTION | YES | DATA
Prewritten question 1 | X | Prewritten data 1
Prewritten question 2| | Prewritten data 2
Prewritten question 3| X | Prewritten data 3
How would I then automate populating a new word document with the data with the variable X under YES, only pasting the prewritten data held in the data column?
I almost got this working on Word just using the step by step mail merger feature , but while I was able to populate the Word document, the Prewritten data would paste, but each pasted selection from the data column would take its own page on Word, even if it was a short 3 word phrase.
Any help would be much appreciated, thanks.