1、怎样为 word 中的数字快速批量添加千位分隔符只需将我测试通过的宏代码粘贴到你的 word 的 normal.wot 模板中即可。某些时候 360 安全杀毒会误报为病毒。在此郑重声明:我的原始代码绝不包含病毒!Sub 千位分隔符()Dim i As Range, Acell As Cell, CR As RangeOn Error Resume NextApplication.ScreenUpdating = FalseIf Selection.Type = 2 ThenFor Each i In Selection.WordsIf i Like “#*“ = True ThenIf i.N
2、ext Like “.“ = True And i.Next(wdWord, 2) Like “#*“ = True Theni.SetRange Start:=i.Start, End:=i.Next(wdWord, 2).Endi = Format(i, “Standard“)Elsei = Format(i, “Standard“)End IfEnd IfNext iEnd IfIf Selection.Type = 5 ThenFor Each Acell In Selection.CellsSet CR = ActiveDocument.Range(Acell.Range.Start
3、, Acell.Range.End - 1)If CR Like “#*“ = True ThenIf CR Like “#.#*“ = True ThenNn = Format(CR, “Standard“)CR.Text = NnElseNn = Format(CR, “Standard“)CR.Text = NnEnd IfEnd IfNext AcellEnd Ifx = MsgBox(“千位分隔符已添加完毕!“, , “仇恨日本军国主义“)Application.ScreenUpdating = TrueEnd Sub以上代码,本人在 20 页数字、文字、表格交叉的文档中,最快用 10 秒添加完毕,最慢用34 秒添加完毕。