|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub aaaa用代码把答案输入到括号中()
- Dim i$, j&, k&, arr, r As Range, t As Table, n&
- With Selection
- If Not .Information(12) Then MsgBox "请将光标放在表格中!", 0 + 16: End
- Set t = .Tables(1)
- .Start = .Tables(1).Range.Next.Start
- Do While Not .Paragraphs(1).Range Like "参考答案*"
- .Move 4
- n = n + 1
- If .Paragraphs(1).Range.End = ActiveDocument.Content.End Then Exit Do
- Loop
- If n > 3 Then End
- If Not .Paragraphs(1).Range Like "参考答案*" Then End
- i = .Paragraphs(1).Range.Text
- i = Mid(i, 6, Len(i) - 6)
- i = Replace(i, " ", " ")
- i = Replace(i, ".", "")
- arr = Split(i, " ")
- End With
- With t
- k = .Columns(1).Cells.Count
- For j = 1 To k
- Set r = .Cell(j, 1).Range
- With r
- .Text = "( " & arr(j - 1) & " )"
- If .Text Like "( [0-9]*" Then .Characters(3).Delete
- If .Text Like "( [0-9]*" Then .Characters(3).Delete
- End With
- Next
- .Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
- End With
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|