|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 413191246se 于 2018-4-3 23:06 编辑
- Sub 下划线数字()
- '循环查找下划线数字
- Dim r As Range
- With Selection
- .HomeKey unit:=wdStory
- With .Find
- .ClearFormatting
- .Font.Underline = wdUnderlineSingle
- Do While .Execute("", , , 1, , , 1)
- Set r = Selection.Range
- Do While Selection Like "[!0-9]*"
- .Parent.MoveStart unit:=wdCharacter, Count:=1
- Loop
- Do While Selection Like "*[!0-9]*"
- .Parent.MoveEnd unit:=wdCharacter, Count:=-1
- Loop
- Selection.Text = Selection.Text + 15
- r.Select
- Selection.Collapse 0
- Loop
- End With
- End With
- End Sub
- Sub 表格数字()
- '循环遍历单元格(第一列)
- Dim t As Table, c As Cell, i&
- For Each c In ActiveDocument.Tables(1).Columns(1).Cells
- c.Range.Text = "( )" & 3 + i & "."
- i = i + 1
- Next
- End Sub
复制代码 |
|