Link to home
Start Free TrialLog in
Avatar of Chris Johnsen
Chris Johnsen

asked on

Export excel to word multiple times on single row if needed

Have a excel sheet that has many rows of data in it ( about 500 ).  Need a way to export each row to a word document.  I know this can be done per row with VB but the issue I am running into is that I have my data on the fourth tab on the excel Sheet and I need to export each row sometime once and other time more then this.  The reason is that it is for a drawing based item and if joe purchased 10 tickets I need to be able to export that row 10 times to a printable ticket to be able to pick from at the end of the drawing.  bit maybe Mary only bought 1 ticket and I need to print that row to word only once.

Any help would be great.

Thank you,

Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

I would normally suggest Mail Merge for tasks like this but don't know how you would do the multiple page option.
A representative sample workbook might be helpful.

My gut feeling is that you need some intermediate form of the data, before you export to Word.
Avatar of byundt
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
With Byundt's VBA creating the repeated rows in Excel, you could then use a RANDBETWEEN function to do a random selection of a row rather than printing multiple times and having to cut up for manual drawing.

=RANDBETWEEN(1, 500)   would select a random number between 1 and 500, adjust the 1 to 2 if you have headers in row 1 and the 500 to the number of rows after Byundt's VBA has run.