|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub aaaa_keep_2_decimals()
- Dim t As Table, c As Cell, r As Range
- Documents.Add (ActiveDocument.FullName)
- With ActiveDocument
- .Select
- CommandBars.FindControl(ID:=123).Execute
- CommandBars.FindControl(ID:=122).Execute
- For Each t In .Tables
- With t
- For Each c In .Columns(5).Cells
- Set r = c.Range
- With r
- .MoveEnd 1, -1
- .Font.ColorIndex = wdRed
- If Not .Text Like "*.*" Then .Text = .Text & ".00"
- End With
- Next
- For Each c In .Columns(14).Cells
- Set r = c.Range
- With r
- .MoveEnd 1, -1
- .Font.ColorIndex = wdPink
- If Not .Text Like "*.*" Then .Text = .Text & ".00"
- End With
- Next
- End With
- Next
- End With
- Selection.HomeKey 6
- Windows.CompareSideBySideWith "保留两位小数"
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|