View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Need a macro to count number of occurrences

Hi Gav

" Thanks Per, this pointed me in the right direction.. with some slight
modification it does exactly what I need..


Thanks for your reply.

I just realised that if an employee is sick on the last day of a month and
the first day of next month, it will count as 2 periods :-(

To fix this "bug" add this line after "IsSick=IsSick+1"

If MyMonth < 13 And Col = LastColumn And Sheets(MyMonth + 1).Cells(r, 4) =
"s" Then IsSick = IsSick - 1

Regards

Per