因無資格下載檔案,用猜的。
cw = "1109,1160,1150,1110,1130,1141,1171,1172,1173,1176,1174,1175,1623,1180,1201,1610,1621,1622,1630,1710"
For Each sh In Worksheets
If InStr(cw, Right(sh.Name, 4)) <> 0 Then UserForm1.ListBox2.AddItem sh.Name
Next sh作者: marco2000 時間: 2014-2-18 13:05
無資格下載檔案...
看看底下是否是版大所需?
For i = 0 To ListBox2.ListCount - 1
If ListBox2.Selected(i) = True Then n = n + 1
Next
MsgBox "已經選取 " & n & " 個檔案"作者: Kubi 時間: 2014-2-18 14:05
6# 是說於ListBox2內(可MultiSelect)選取幾個檔案,若是要知道找到了幾個檔案,以及ListBox2內選取幾個檔案於則是用:
For i = 0 To ListBox2.ListCount - 1
If ListBox1.Selected(i) = True Then n = n + 1
Next
MsgBox "於" & ListBox2.ListCount & " 個被找到的檔案中,已選了取 " & n & " 個檔案"作者: marco2000 時間: 2014-2-18 14:24
sn = UserForm1.ListBox2.ListCount
If sn = 0 Then
MsgBox "並沒有選到檔案", vbCritical + vbOKOnly, "請重選"
Exit Sub
Else
If MsgBox("選了 " & sn & " 個檔案,是否確定要執行?", vbQuestion + vbYesNo, "請確認") = vbNo Then Exit Sub
End If作者: marco2000 時間: 2014-2-18 20:05