以下是列表框函数的地址 http://www.office-cn.net/forum.php?mod=viewthread&tid=57711&extra=&page=1
我把它COPY到VBA中,发现.....
'=======================
'第一种:
'使用方法UnAbs(列表框名,列数,查找字符)
'返回结果: 包含True , 不包含False
'=======================
Function UnAbs(ListName As ListBox, N As Integer, KeyWord As String) As Boolean
Dim I As Integer
Dim S As Integer
For I = 1 To
ListName.ListCount -1
If ListName.Column(N, I) = KeyWord
Then S = S + 1
Next
If S > 0 Then
UnAbs = True
Else
UnAbs = False
End If
End Function
部分函数内容变成红色字体。不知有用过的朋友是不是也这样................
本人见识少..............改成以下可解决.............
Function UnAbs1(ListName As ListBox, N As Integer, KeyWord As String) As Boolean
Dim I As Integer
Dim S As Integer
For I = 1 To ListName.ListCount - 1
If ListName.Column(N, I) = KeyWord Then
S = S + 1
Next