Sub 已繳()
Dim xF As Range, M
If [A2] = "" Then MsgBox "學號未輸入 ": Exit Sub
If [B2] = "" Then MsgBox "繳費月份未輸入 ": Exit Sub
Set xF = [工作表2!A:A].Find([A2], Lookat:=xlWhole)
If xF Is Nothing Then MsgBox "學號不存在 ": Exit Sub
For Each M In Split([B2], ",")
If Val(M) < 1 Or Val(M) > 12 Then MsgBox "繳費月份錯誤 ": Exit Sub
Next
For Each M In Split([B2], ",")
If IsNumeric(M) Then xF(1, M + 2) = "已繳"
Next
MsgBox "∼∼已處理∼∼"
End Sub作者: bear0925900003 時間: 2015-11-28 23:30