Sarahmueller
New Member
- Joined
- May 17, 2020
- Messages
- 24
- Office Version
- 365
- 2016
- Platform
- Windows
Hello,
I have a word document, in which results of medicinical tests are documented.
Several tables are part of the document. In these tables, the results of tests for the current and the last weeks are stored.
Afterwards, an assesment by the responsible doctor is provided. Therefore, I have to work with word, and can´t just use excel.
The tables are looking as follows:
Table 1: Medication 1 (week 1)
I have tried to write a macro that automatically switches the values of the columns after application, so that the table looks as follows:
Table 1: Medication 1 (week 2)
I have tried 2 solutions:
1) Edit the tables in Word with record a macro: Doesn´t work, because the selection always changes depending of the length of the doctors assessment
2) Insert tables from Excel into the word document (paste-special - excel worksheet object). I have also written excel makros to switch the columns, but I cant start the excel-macros automatically in word. I always have to double-click on the table, so that an excel worksheet opens and i have to manually activate the macro.
Therefore, i kindly ask you the following questions:
1) is it possible to write a macro in word to automatically edit word-tables?
2) Is ist possible to automatically run an macro in an embedded excel sheet from Microsoft word via vba?
Thank you in advance and stay healthy,
Sarah
I have a word document, in which results of medicinical tests are documented.
Several tables are part of the document. In these tables, the results of tests for the current and the last weeks are stored.
Afterwards, an assesment by the responsible doctor is provided. Therefore, I have to work with word, and can´t just use excel.
The tables are looking as follows:
Name of patient | Current week | 1 weeks ago |
Name 1 | X | Y |
Name 2 | X | Y |
I have tried to write a macro that automatically switches the values of the columns after application, so that the table looks as follows:
Name of patient | Current week | 1 week ago |
Name 1 | X | |
X |
I have tried 2 solutions:
1) Edit the tables in Word with record a macro: Doesn´t work, because the selection always changes depending of the length of the doctors assessment
2) Insert tables from Excel into the word document (paste-special - excel worksheet object). I have also written excel makros to switch the columns, but I cant start the excel-macros automatically in word. I always have to double-click on the table, so that an excel worksheet opens and i have to manually activate the macro.
Therefore, i kindly ask you the following questions:
1) is it possible to write a macro in word to automatically edit word-tables?
2) Is ist possible to automatically run an macro in an embedded excel sheet from Microsoft word via vba?
Thank you in advance and stay healthy,
Sarah