返回列表 上一主題 發帖

[發問] IF AND OR 如何適用?

[發問] IF AND OR 如何適用?

若想用VBA 的IF句法,來判斷每季財報自動更新,該如何寫?
If .Cells(r, "EN") = "" Or (Date >= DateSerial(Year(Date), 3, 31) And Date < DateSerial(Year(Date), 4, 1)) Or (Date >= DateSerial(Year(Date), 5, 14) And Date < DateSerial(Year(Date), 5, 16)) Or (Date >= DateSerial(Year(Date), 8, 14) And Date < DateSerial(Year(Date), 8, 16)) Or (Date >= DateSerial(Year(Date), 11, 14) And Date < DateSerial(Year(Date), 11, 16)) Then Exit Sub
出現程式物件定義錯誤,請前輩高手指正!
Lin

謝謝版主賜教,感恩!
Lin

TOP

        靜思自在 : 一個人的快樂.不是因為他擁有得多,而是因為他計較得少。
返回列表 上一主題