发布网友 发布时间:2022-04-27 12:23
共2个回答
热心网友 时间:2023-09-18 22:42
这样的话,就得使用 VB 编辑器,可惜偶不在行EXCEL --工具--宏--VB 编辑器,楼主可以研究一下或咨询下懂编程的人热心网友 时间:2023-09-18 22:43
Function comp(index As Long) As StringDim str As StringDim i As Longstr = Range("A" & index).ValueFor i = 1 To Rows.CountIf StrComp(str, Range("B" & i).Value, vbTextCompare) = 0 Thencomp = strExit FunctionEnd IfNextEnd FunctionSub run()Dim i As LongFor i = 1 To Rows.CountRange("C" & i).Value = comp(i)NextEnd Sub