Relative Content

Tag Archive for excelvbams-word

Insert page break in Word document using macro in Excel

I am trying to have my macro make three tables in Word. It currently makes one big table and formats it correctly, but I can’t find how to force a page break at the desired times. I found a macro that was using vba in Word and they used .InsertBreak but this keeps causing an error when I run it.

VBA – Need to cretae multiple word docs

i’m hoping someone could help me change this code so that it creates word docs for every item in the data validation list. At the moment the code only creates one word doc at a time with manual list items selected. The list uses a source where I have pasted the list items in seperate cells in a single row. Im not sure how I can get VBA to loop through the list items and create the seperate word documents, where each item changes the cell data in the given table. Also, the list is located in a merged cell (B9:C9). Any help will be appreciated!

VBA .cells recognizes value in some cells but not others

I’m trying to iterate through a list of values in excel to populate certain parts of a word document. The VBA script finds the strings listed in the arrays declared at the top (“revArrayY1”, etc) and replaces that text with corresponding values in a spreadsheet using the .Cells function to grab the value. It worked at first, but when adding another row to the list of values in excel to populate, the .Cells function won’t recognize the value in the new cell. All I did was shift the cells in excel up to make room for the new row and add a new string to the array.

Excel VBA to Word string replacement

I have a code snippet that pulls the data from my Excel workbook into an array and then populates the list within a Word document. There are multiple lists within the document and each has a unique placeholder. The code runs perfectly well for 5 out of 6 lists, but for some reason mashes all arrays together into the 2nd list. A snippet of the code below: