I am new to VBA and I would like seek help to create a Word macro to copy certain content tables from Microsoft Office 365 Word Document A to Microsoft Office 365 Word Document B.
- Document A has at least 1 content table, but it can have up to, for example, 20 content tables. In order words, the upper bound is dynamic.
1.1 Each content table has two rows and four columns:
1.1.1 the first row has four column cells,
1.1.2 the second row has the first and second column cells merged into one cell, and thus the second row has three columns.
Document B is a blank template. It has some pre-defined text content and then followed by 20 blank content tables. The content table structure in Document B is the same as that in Document A.
The macro needs to do the following:
3.1 Copy the content tables from Document A to Document B in the same sequential order.
3.2 For each content table in Document A, copy as below:
3.2.1 Copy the first row as is to the first row of the corresponding content table in Document B.
3.2.2 Copy the second row as below:
3.2.2.1 Copy the second row’s first column/cell in Document A to the second row’s first column/cell in Document B.
3.2.2.2 Copy the second row’s third column/cell in Document A to the second row’s second column/cell in Document B. That’s all.
I tried to record a macro to do the above but it did not work.
Please kindly advise and help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…