Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1617|回复: 6

[待分类] 。。。。。。。。。。。。。。。。。。。

[复制链接]
发表于 2015-6-15 19:29 | 显示全部楼层 |阅读模式
本帖最后由 大漠憨憨 于 2015-6-17 10:09 编辑

。。。。。。。。。。。。。。。。。。。。。。
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
 楼主| 发表于 2015-6-15 19:32 | 显示全部楼层
回复

使用道具 举报

 楼主| 发表于 2015-6-15 19:40 | 显示全部楼层
回复

使用道具 举报

发表于 2015-6-15 20:52 | 显示全部楼层
Sub 倒序排列()
Dim oText As String, a() As String, i As Long, j As Long, temp As String
oText = IIf(Selection.Type = wdSelectionIP, ActiveDocument.Content.Text, Selection.Text)
oText = Left(oText, Len(oText) - 1)
a() = Split(oText, Chr(13))
For i = 0 To UBound(a) - 1
     For j = i + 1 To UBound(a)
         If Len(a(i)) < Len(a(j)) Then
             temp = a(j)
             a(j) = a(i)
             a(i) = temp
         End If
     Next j
Next i
Documents.Add.Content.Text = Join(a, Chr(13))
End Sub
Sub 正序排列()
Dim oText As String, a() As String, i As Long, j As Long, temp As String
oText = IIf(Selection.Type = wdSelectionIP, ActiveDocument.Content.Text, Selection.Text)
oText = Left(oText, Len(oText) - 1)
a() = Split(oText, Chr(13))
For i = 0 To UBound(a) - 1
     For j = i + 1 To UBound(a)
         If Len(a(i)) > Len(a(j)) Then
             temp = a(j)
             a(j) = a(i)
             a(i) = temp
         End If
     Next j
Next i
Documents.Add.Content.Text = Join(a, Chr(13))
End Sub
回复

使用道具 举报

 楼主| 发表于 2015-6-16 10:52 | 显示全部楼层
scl5801 发表于 2015-6-15 20:52
Sub 倒序排列()
Dim oText As String, a() As String, i As Long, j As Long, temp As String
oText = I ...

复制程序是没用的!!!
回复

使用道具 举报

发表于 2015-6-16 12:32 | 显示全部楼层
大漠憨憨 发表于 2015-6-16 10:52
复制程序是没用的!!!

?????   给你修改好了,咋这样说?你测试一下看是否能用?
回复

使用道具 举报

 楼主| 发表于 2015-6-16 13:45 | 显示全部楼层

。。。。。。。。。。。。。。。。。。。。。

本帖最后由 大漠憨憨 于 2015-6-17 10:11 编辑
scl5801 发表于 2015-6-16 12:32
?????   给你修改好了,咋这样说?你测试一下看是否能用?

。。。。。。。。。。。。。。。。。。。。。。。。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-16 07:02 , Processed in 0.234135 second(s), 7 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表