C
Cimjet
Hi Everyone
What I've got is a 12 month vacation planner and the dates are replace with the
letter V for vacation or I for illness, plus they count half days.
I'm replacing this formula.
=COUNTIF($B$6:$AF$17,"V")+COUNTIF($B$21:$AF$32,"V")+COUNTIF($B$36:$AF$47,"V")+(COUNTIF(B7:AF47,"½
v")/2)
With this macro, but need to do it for half days and for ( I ) Illness and on 17
w.sheets
I try different things but seem to get in a constant loop and I need your help.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim sz As Variant, t As Long
For Each sz In _
Array("$B$6:$AF$17", "$B$21:$AF$32", "$B$36:$AF$47")
t = t + _
Application.WorksheetFunction.CountIf(Range(sz), "V")
Next
Range("I51") = t
End Sub
End Sub
Regards
Cimjet
What I've got is a 12 month vacation planner and the dates are replace with the
letter V for vacation or I for illness, plus they count half days.
I'm replacing this formula.
=COUNTIF($B$6:$AF$17,"V")+COUNTIF($B$21:$AF$32,"V")+COUNTIF($B$36:$AF$47,"V")+(COUNTIF(B7:AF47,"½
v")/2)
With this macro, but need to do it for half days and for ( I ) Illness and on 17
w.sheets
I try different things but seem to get in a constant loop and I need your help.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim sz As Variant, t As Long
For Each sz In _
Array("$B$6:$AF$17", "$B$21:$AF$32", "$B$36:$AF$47")
t = t + _
Application.WorksheetFunction.CountIf(Range(sz), "V")
Next
Range("I51") = t
End Sub
End Sub
Regards
Cimjet