I currently have an excel document that is acting as my database with data arranged in rows. From time to time I need to export particular data to word documents that act as my templates. My current solution for this was to link each cell of my table in word to the appropriate cell in my excel document. However, I have discovered that this link is an absolute link and does not move with my excel file. For example, I have the following table:[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A1[/TD]
[TD]B1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]A2[/TD]
[TD]B2[/TD]
[/TR]
</tbody>[/TABLE]
Sometimes I may sort my excel data in different ways and the rows that my data appears in may change, such as:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A2[/TD]
[TD]B2[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]A1[/TD]
[TD]B1[/TD]
[/TR]
</tbody>[/TABLE]
My intent is that I will link my word document such that I can always retrieve the value of the cell next to "A1" in my Word document. However, my word document is linked such that it only cares about the absolute cell reference. The way that Word handles this is that in the first table, if I linked to B1, I would receive "B1". After the table is sorted though, I receive "B2" since that is the entry in cell B1.
The Word templates (and there are many different template files that all feed off of the same excel spreadsheet) are composed of several individual tables, so I don't believe linking an entire table will work either. Would a macro be able to solve this for me? Could the macro be generated from Word to then call on the other excel file and the correct cells (the value next to "A1"). Any help on this issue would be much appreciated.
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A1[/TD]
[TD]B1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]A2[/TD]
[TD]B2
[/TD]
[/TR]
</tbody>[/TABLE]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A1[/TD]
[TD]B1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]A2[/TD]
[TD]B2[/TD]
[/TR]
</tbody>[/TABLE]
Sometimes I may sort my excel data in different ways and the rows that my data appears in may change, such as:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A2[/TD]
[TD]B2[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]A1[/TD]
[TD]B1[/TD]
[/TR]
</tbody>[/TABLE]
My intent is that I will link my word document such that I can always retrieve the value of the cell next to "A1" in my Word document. However, my word document is linked such that it only cares about the absolute cell reference. The way that Word handles this is that in the first table, if I linked to B1, I would receive "B1". After the table is sorted though, I receive "B2" since that is the entry in cell B1.
The Word templates (and there are many different template files that all feed off of the same excel spreadsheet) are composed of several individual tables, so I don't believe linking an entire table will work either. Would a macro be able to solve this for me? Could the macro be generated from Word to then call on the other excel file and the correct cells (the value next to "A1"). Any help on this issue would be much appreciated.
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A1[/TD]
[TD]B1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]A2[/TD]
[TD]B2
[/TD]
[/TR]
</tbody>[/TABLE]