下面是当前单元格缩进代码,想遍历所有表、所有单元格后,再执行。
1、缩进代码:
Dim str As String = CurrentTable.Value str = str.Replace(chr(10), "").replace(" ", "") str = " " & str.Replace(chr(13), vbcrlf & " ").trim() CurrentTable.Value = str
2、遍历代码:
For Each t As Table In Tables For Each r As Row In t.rows For Each c As Col In t.cols
Next NextNext
3、所有单元格缩进2个字符:
谢谢!