Hi 感謝您的回覆
因我在工作表中E2~AH6都有設定COUNTIFS函數公式
是否可以用VBA取代?作者: prin.huang 時間: 2017-4-27 15:06
Sub CNTIF()
Dim MySt1 As Worksheet, MySt2 As Worksheet
Dim I&, J&
Set MySt1 = Workbooks("0427.xlsx").Worksheets("日報表")
Set MySt2 = Workbooks("0427.xlsx").Worksheets("產能進度")
For I = 2 To 6
For J = 5 To 34
MySt2.Cells(I, J) = Application.WorksheetFunction.CountIfs(MySt1.Columns(2), MySt2.Cells(I, 1), MySt1.Columns(11), MySt2.Cells(I, 2), MySt1.Columns(12), MySt2.Cells(1, J))
Next J
Next I
End Sub作者: jsc0518 時間: 2017-4-27 16:55