|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub zz()
- Dim Mytxt, Mysentence, c As New Collection, n&, s$, a
- a = Selection
- Mysentence = Split(LCase(a), Chr(13))
- For i = 0 To UBound(Mysentence)
- If Len(Mysentence(i)) = 0 Then GoTo 1000
- Set c = Nothing
- Mytxt = Split(Trim(Mysentence(i)), " ")
- s = Right(Mytxt(UBound(Mytxt)), 1)
- Mytxt(UBound(Mytxt)) = Replace(Mytxt(UBound(Mytxt)), s, "")
- For j = 0 To UBound(Mytxt)
- c.Add Mytxt(j)
- Next
- For j = 1 To c.Count
- n = Int((c.Count * Rnd) + 1)
- Mytxt(j - 1) = c(n)
- c.Remove (n)
- Next
- Mytxt(j - 2) = Mytxt(j - 2) & s
- Mysentence(i) = Join(Mytxt, " ")
- 1000
- Next
- Documents.Add DocumentType:=wdNewBlankDocument
- a = a & Chr(13) & Chr(13) & Join(Mysentence, Chr(13))
- Selection = a
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|