Function intFindUser (strUserList(), strTargetUser) Dim i ' 循環計數器。 Dim blnFound ' 發現目標的標記。 intFindUser = -1 i = 0 ' 初始化循環計數器。 Do While i = Ubound(strUserList) and Not blnFound If strUserList(i) = strTargetUser Then blnFound = True ' 標記設為 True。 intFindUser = i ' 返回值設為循環計數器。 End If i = i + 1 ' 循環計數器加 1。 Loop End Function