Adding a condition to VBA CountIF
Hi Rick
Layout
E G H I J
Name Hrs Breaks PreOps Signed
Jack OK NO OK OK
Pete NO OK OK NO
John OK OK OK OK
There is up to 28 Drivers covering up to 31 days in the month, and each
months data is copied to an appending ("Summary") sheet - [this section I
have no probs with]...
Essentially, this is a compliance checklist that gets done each day for the
previous days activities.
I am attempting to consolidate a count for each driver and the respective
("G:J") range from the Summary sheet where the driver registers any ("NO")
values.
I have used this particular routine on a couple of other files very
effectively, granted they were all straight forward calculating numerics and
not criteria driven cell counting as is the need on this occasion.
The desired wksTarget result would be:
E G H I J
Name Hrs Breaks PreOps Signed
Jack 0 1 0 0
Pete 1 0 0 1
John 0 0 0 0
When the driver registers a certain overall score a warning letter is raised
and if not corrected, further action is taken until the driver complies with
the Federal & State laws governing the industry activities.
The Source sheet ("Summary") will continue to update with data from each
month, then I run this update code which coallates the (Array, if you like)
again to include the fresh information.
If this is to hard to accomplish, I may just create a ghost section of the
sheet and convert the text values to (0) zeros = "OK" & (1) ones = "NO" and
calculate them that way as the code works fine numerically, just means a
little more work and a larger file size.
Appreciate your time.
Mick.
|