Excel精英培训网

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

[已解决]请教:数据去重复降序排列的宏

[复制链接]
发表于 2015-12-13 11:58 | 显示全部楼层 |阅读模式
本帖最后由 海水鱼 于 2015-12-17 09:29 编辑

请看:附件,谢谢
最佳答案
2015-12-14 15:50
  1. Sub tt()
  2.     Set d = CreateObject("scripting.dictionary")
  3.     For j = 4 To 7
  4.         arr = Range(Cells(10, j), Cells(65536, j).End(3))
  5.         For Each x In arr
  6.             d(x) = ""
  7.         Next
  8.         Cells(10, j + 5).Resize(d.Count, 1) = Application.Transpose(d.keys)
  9.         Cells(10, j + 5).Resize(d.Count, 1).Sort key1:=Cells(10, j + 5), order1:=xlDescending
  10.         d.RemoveAll
  11.     Next
  12. End Sub
复制代码

请教:数据去重复降序排列的宏.zip

1.66 KB, 下载次数: 14

excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2015-12-13 15:49 | 显示全部楼层
本帖最后由 sry660 于 2015-12-13 15:51 编辑
  1. Sub 删除重复后排序()
  2. Application.ScreenUpdating = False
  3. Application.DisplayAlerts = False
  4. Dim i%
  5. [d10].CurrentRegion.Copy [o10]
  6. For i = 15 To 18
  7.     With Range(Cells(10, i), Cells(21, i))
  8.         .RemoveDuplicates Columns:=1, Header:=xlNo
  9.         .Sort Key1:=Cells(10, i), Order1:=xlDescending
  10.     End With
  11. Next
  12. Application.DisplayAlerts = True
  13. Application.ScreenUpdating = True
  14. End Sub
复制代码

请教:数据去重复降序排列的宏.rar

7.7 KB, 下载次数: 12

回复

使用道具 举报

发表于 2015-12-14 15:50 | 显示全部楼层    本楼为最佳答案   
  1. Sub tt()
  2.     Set d = CreateObject("scripting.dictionary")
  3.     For j = 4 To 7
  4.         arr = Range(Cells(10, j), Cells(65536, j).End(3))
  5.         For Each x In arr
  6.             d(x) = ""
  7.         Next
  8.         Cells(10, j + 5).Resize(d.Count, 1) = Application.Transpose(d.keys)
  9.         Cells(10, j + 5).Resize(d.Count, 1).Sort key1:=Cells(10, j + 5), order1:=xlDescending
  10.         d.RemoveAll
  11.     Next
  12. End Sub
复制代码

请教:数据去重复降序排列的宏.rar

8.85 KB, 下载次数: 14

回复

使用道具 举报

发表于 2015-12-14 20:12 | 显示全部楼层
见附件,内详。

请教:数据去重复降序排列的宏.zip

10.42 KB, 下载次数: 10

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-20 07:18 , Processed in 0.313892 second(s), 11 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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