|
本帖最后由 duquancai 于 2016-6-20 12:32 编辑
Sub test1()
With ActiveDocument.Tables(1)
.Sort , "列1"
.Cell(1, 1).Range.Font.ColorIndex = 6
.Cell(2, 1).Range.Font.ColorIndex = 6
.Cell(3, 1).Range.Font.ColorIndex = 6
End With
End Sub
+++++++++++++++++++++++++++++++++++++++++++
Sub test2()
Dim i%, j%
With Selection.Tables(1) '先选中要操作的一个表格
.Columns.Add
For i = 1 To .Rows.Count
.Cell(i, 2).Range = i
Next
.Sort , "列1"
For j = 1 To 3
.Cell(j, 1).Range.Font.ColorIndex = 6
Next
.Sort , "列2"
.Columns(2).Delete
End With
End Sub
|
|