EXCEL 如何将重复的字节变成单一的字节
发布网友
发布时间:2022-04-23 03:16
我来回答
共2个回答
热心网友
时间:2023-07-03 04:50
用宏吧,选中你要处理的列,然后运行宏就好了。
Sub 去重()
Dim rng As Range, cl As Range, tmp As String
Dim reg As Object
Set rng = Intersect(ActiveSheet.UsedRange, Selection)
Set reg = CreateObject("vbscript.regexp")
reg.Pattern = "(.+?)\1+"
reg.Global = True
For Each cl In rng
If reg.test(cl.Value) = True Then
tmp = reg.Replace(cl.Value, "$1")
cl = tmp
End If
Next
End Sub
热心网友
时间:2023-07-03 04:50
如果都相同格式,把问题作为内容(邮件主题一定要包含“excel”,本人以此为依据辨别非垃圾邮件,以免误删)、excel样表文件(把现状和目标效果表示出来)作为附件发来看下 yqch134@163.com