请问excel自定义函数searchit怎么用啊?
发布网友
发布时间:2022-05-01 17:18
我来回答
共1个回答
热心网友
时间:2022-06-20 04:51
(程序补充)
'这个是调用的格式
Sub Test()
Dim sea_i, i As Integer
Dim coli, col1, col2, col3, col4 As Integer
coli = transtoi(Application.InputBox("请输入列", "要查找列数", , , , , , 2))
col1 = transtoi(Application.InputBox("请输入行", "要查找匹配列数", , , , , , 2))
col2 = transtoi(Application.InputBox("请输入行", "要查找匹配列数", , , , , , 2))
col3 = transtoi(Application.InputBox("请输入行", "要查找匹配列数", , , , , , 2))
col4 = transtoi(Application.InputBox("请输入行", "要查找匹配列数", , , , , , 2))
col_end = transtoi(Application.InputBox("请结果行", "要结果的行数", , , , , , 2))
i = 2
Do
sea_i = searchit(Cells(i, coli), Range(Cells(1, col_end), Cells(10000, col_end)) _
, Range(Cells(1, col1), Cells(10000, col1)) _
, Range(Cells(1, col2), Cells(10000, col2)), Range(Cells(1, col3), Cells(10000, col3)) _
, Range(Cells(1, col4), Cells(10000, col4)))
Cells(i, col_end) = sea_i
i = i + 1
Loop While Cells(i, coli) <> 0
MsgBox (i)
End Sub