返回列表 上一主題 發帖

計算生產過程中的假日

回復 1# hugh0620

增加假日表輔助欄
然後先算出下線日
再反推假日數
如附件 計算生產過程中的假日.zip (23.94 KB)
學海無涯_不恥下問

TOP

本帖最後由 Hsieh 於 2011-1-6 14:11 編輯

回復 3# hugh0620
  1. Private Sub CommandButton1_Click()
  2. Dim st As Date, ed As Date
  3. st = InputBox("請輸入起始日期", , Date)
  4. ed = InputBox("請輸入結束日期", , Date + 30)
  5. Set a = Columns("A").Find(st, LookIn:=xlValues)
  6. Set b = Columns("A").Find(ed, LookIn:=xlValues)
  7. If a Is Nothing Or b Is Nothing Then MsgBox "The day is not found": Exit Sub
  8. [E2] = Application.Sum(Range(a.Offset(, 4), b.Offset(, 4)))
  9. MsgBox Application.Sum(Range(a.Offset(, 4), b.Offset(, 4)))
  10. End Sub
複製代碼
學海無涯_不恥下問

TOP

        靜思自在 : 稻穗結得越飽滿,越會往下垂,一個人越有成就,就要越有謙沖的胸襟。
返回列表 上一主題