Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vba 如何在Word中为所有表交换行?_Vba_Ms Word_Copy_Rows - Fatal编程技术网

Vba 如何在Word中为所有表交换行?

Vba 如何在Word中为所有表交换行?,vba,ms-word,copy,rows,Vba,Ms Word,Copy,Rows,我有290张桌子,每张桌子有14行。我想把第12行移到第13行下面。你知道宏吗 我试着复制和删除重复的,但我需要它的290表,所以我需要在VBA循环 Sub Sample() Dim tbl As Table Set tbl = ActiveDocument.Tables(1) tbl.Rows(12).Range.Copy tbl.Rows(14).Range.Paste End Sub 我已经很久没有在Word中做过很多工作了,但请尝试一下 Sub Samp

我有290张桌子,每张桌子有14行。我想把第12行移到第13行下面。你知道宏吗

我试着复制和删除重复的,但我需要它的290表,所以我需要在VBA循环

Sub Sample()
    Dim tbl As Table
    Set tbl = ActiveDocument.Tables(1)
    tbl.Rows(12).Range.Copy
    tbl.Rows(14).Range.Paste
End Sub
我已经很久没有在Word中做过很多工作了,但请尝试一下

Sub Sample() 

  Dim tbl As Table

  For Each tbl in ActiveDocument.tables
    tbl.Rows(12).Range.Copy
    tbl.Rows(14).Range.Paste
  Next

End Sub