3个回答
展开全部
测试了下运行效率,10000个数据大概2秒左右,不知能否满足你的要求。
Sub TextCompare()
Dim CpString As String
Dim OriRang As Range
Dim cell As Range
Dim I As Integer
CpString = Range("B1").Value
Set OriRang = Range("A1:A10000")
For Each cell In OriRang
cell.Offset(0, 2) = "√"
For I = 1 To Len(CpString)
If InStr(1, cell, Mid(CpString, I, 1)) > 0 Then
cell.Offset(0, 2) = "ⅹ"
Exit For
End If
Next
Set cell = cell.Offset(1, 0)
Next
End Sub
更多追问追答
追问
老师我待会试一下 如果有问题 再麻烦你 好吗?
追答
可以的
展开全部
用公式能解决的,不必VBA吧
追问
量大 公式太卡了
帮帮忙帮我弄一下
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
For i = 1 To Len([b1])
Set c = [a:a].Find(Mid([b1], i, 1), , , xlPart)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Range("c" & c.Row) = "√"
Set c = [a:a].FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
Next
temp = Range("c1:c" & [a1].End(xlDown).Row).Replace("", "×")
Set c = [a:a].Find(Mid([b1], i, 1), , , xlPart)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Range("c" & c.Row) = "√"
Set c = [a:a].FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
Next
temp = Range("c1:c" & [a1].End(xlDown).Row).Replace("", "×")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询