I am trying to automatically create a formatted Word report from an Excel template used by several commands. For example, if I have the following Excel structure:
...... A .... | ..... B .... | .... C ...
1 Name | Height | Weight
2 Jason | 74 | 170
3 Greg | 70 | 160
4 Sam | 71 | 200
and I want to pull this data and format it into a Word file with the following format:
2.1 Jason
Growth: 74
Weighing: 170
2.2 Greg
Growth: 70
Weight: 160
2.3 Sam
Growth: 71
Weight: 200
Is there a quick way to do this using VBA and be able to iterate over as many rows as can exist in any particular Excel file? (may vary from several to several hundred). The actual excel file contains about a dozen columns, where for each record (line) the data needs to be pulled out and formatted using a standard template (font size / color, indentation, alignment, etc.) ...), but I would just like to extract extract to work, and I can play with formatting later.
For reference, I tried to investigate well-known solutions, but most of them are focused on named bookmarks and relatively static content, as well as on interaction through a dynamic number of lines and analysis of the same data for each.
source share