以下是引用守柔在2006-8-8 6:19:53的发言:给高手们一点时间好吗?你以为象你想象的好做吗? 看看你第二个附件,我在四楼的话白说了。 我冒充一下高手,不知你是否同意,做了一个,供参考。 '* +++++++++++++++++++++++++++++ '* Created By SHOUROU@ExcelHome 2006-8-8 6:16:24 '仅测试于System: Windows NT Word: 11.0 Language: 2052 '№ 0051^The Code CopyIn [ThisDocument-ThisDocument]^' '* ----------------------------- Option Explicit Sub Example() Dim myTable As Table, myColumn As Column, i As Cell Dim RowCount As Integer Dim CellArray() As Integer, ListArray() As Integer Dim N As Integer, L As Integer, K As Integer, S As Integer On Error Resume Next '忽略错误 Application.ScreenUpdating = False '关闭屏幕更新 Set myTable = ActiveDocument.Tables(1) '定义一个表格对象 Set myColumn = myTable.Columns(1) '定义一个列对象 RowCount = myColumn.Cells.Count '取得指定列的单元格数量 For Each i In myColumn.Cells '在列的单元格集合中循环 '如果为空单元格(关键!)并且未自动编号者 If Len(i.Range) = 2 And i.Range.ListFormat.ListString = "" Then ReDim Preserve CellArray(N) '扩充数组 CellArray(N) = i.RowIndex '取得单元格行号 N = N + 1 '累加 '如果是单元格自动编号者 ElseIf i.Range.ListFormat.ListString <> "" Then 守柔兄,你做的这个我早就试了,不行啊。 |