我在Word文件中有一个表格。 这VBA程序下面将通过所有的表格单元迭代如何在MS Word中用VBA修整表格单元值
Dim strCellText As String
Dim uResp As String
Dim Row As Integer
Dim Col As Integer
Dim itable As Table
For Each itable In ThisDocument.Tables
uResp = ""
For Row = 1 To itable.Rows.Count
For Col = 1 To itable.Columns.Count
strCellText = itable.Cell(Row, Col).Range.Text
uResp = uResp & Trim(strCellText)
Next
Next
MsgBox uResp
Next
在线路uResp = uResp & Trim(strCellText)
VBA附加一个新行和点到每个cell.So MsgBox uResp
将显示“列”消息我box.How可以删除换行符和点在显示消息框时。
问题仍然存在。 – Vinod
Clean的介绍没有效果@ rene,你可以在一个简单的词表中进行验证吗? – Vinod
我想你只需要把Word用来移动到下一个表格单元格的最后两个字符去掉,但是你不想在每个单元格之间放一些分隔符? – grahamj42