- Do
- Input = InputBox("输入:")
- If IsEmpty(Input) Then WScript.Quit
- Loop while Input = ""
-
- Set oExcel = CreateObject("Excel.Application")
- oExcel.Visible = false
- oExcel.WorkBooks.Open("d:\test\db1.mdb")
- oExcel.WorkSheets(1).Activate
- row = oExcel.ActiveSheet.UsedRange.Rows.Count
-
- For i = 2 to row
- flag = true
- For j = 1 to Len(Input)
- If InStr(oExcel.Cells(i,4), Mid(Input,j,1)) = 0 Then
- flag = false : Exit For
- End if
- Next
- If flag Then
- s = ""
- For j = 2 to 5
- s = s & oExcel.Cells(i,j) & vbTab
- Next
- MsgBox s
- End If
- Next
- If s = "" Then MsgBox "Not Found"
- oExcel.ActiveWorkBook.Saved = true
- oExcel.WorkBooks.Close
- oExcel.Quit
复制代码
|