Private Sub CommandButton1_Click()
Dim yy, mm, dd
yy = Range("b1")
'對12個月進(jìn)行循環(huán)
For m = 4 To 15
mm = Cells(m, 1)
For dd = 1 To 5
If Weekday(yy & "-" & mm & "-" & dd) = 1 Or Weekday(yy & "-" & mm & "-" & dd) = 7 Then
Else
Cells(m, 2) = yy & "-" & mm & "-" & dd
Exit For
End If
Next dd
Range("d2").AddComment
Next m
End Sub