table1
A1 B1 C1 D1
table2
A2 B2 C2 D2
那么都加一列
E1 = A1&B1&C1&D1
E2 = A2&B2&C2&D2
比较E列就好了 用if(and(exact(),exact(),....)...,...)
这样? 捷径当然有啊,上vba直接用sql,select from,然后输出对比结果和行号
不要太简单
——— 来自Stage1st Reader For iOS 横向多列在vba做个循环咯
——— 来自Stage1st Reader For iOS excel 匹配 这要上最小编辑距离?
不知道excel有没有现成的函数 比较文本相似度是个非常麻烦的东西,建议用专门的东西弄 不懂VBA...照着关键词搜到个现成的 试了下能用比较从文本A编辑到文本B需要的操作次数(增删改) 数字越小说明越相似(准确点是要再除以字符的长度?)
同义词之类就没办法了...Function Levenshtein(ByVal string1 As String, ByVal string2 As String) As Long
Dim i As Long, j As Long
Dim string1_length As Long
Dim string2_length As Long
Dim distance() As Long
string1_length = Len(string1)
string2_length = Len(string2)
ReDim distance(string1_length, string2_length)
For i = 0 To string1_length
distance(i, 0) = i
Next
For j = 0 To string2_length
distance(0, j) = j
Next
For i = 1 To string1_length
For j = 1 To string2_length
If Asc(Mid$(string1, i, 1)) = Asc(Mid$(string2, j, 1)) Then
distance(i, j) = distance(i - 1, j - 1)
Else
distance(i, j) = Application.WorksheetFunction.Min _
(distance(i - 1, j) + 1, _
distance(i, j - 1) + 1, _
distance(i - 1, j - 1) + 1)
End If
Next
Next
Levenshtein = distance(string1_length, string2_length)
End Function
excel记录大量数据的第一生死要务就是不要合并单元格,对我来说是死也要守住的铁则
页:
[1]