|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
看这样行不行
Sub test1()
For i = 1 To ActiveDocument.Paragraphs.Count
p = Replace(ActiveDocument.Paragraphs(i).Range.Text, "。" & vbCr, "")
If p Like "*:*=*" Then
n = Len(Split(p, "=")(1))
g = ""
If n > 8 Then
g = "——"
Else
For m = 1 To (10 - n)
g = g & "—"
Next m
End If
t = Split(p, "=")(1) & g & Split(Split(p, "=")(0), ":")(1) & "——" & Split(Split(p, "=")(0), ":")(0)
ActiveDocument.Paragraphs(i).Range.Text = t & "。" & vbCr
End If
Next
End Sub
|
|