Dim
iVal
As
Integer
Dim
ws
As
Worksheet, sh
As
Worksheet
Dim
i
As
Integer
Dim
entry
As
Integer
Dim
entryoriginal
As
Variant
entryoriginal = Cells(27, 1).Value
entry =
CInt
(entryoriginal)
Set
ws = Sheets(
"Overview"
)
Set
sh = Sheets(
"Tickets"
)
If
((entry >= 40)
And
(entry <= 53))
Then
For
i = 1
To
130
iVal = Application.WorksheetFunction.CountIfs(sh.Range(
"I:I"
), Cells(i + 1, 1).Value, sh.Range(
"C:C"
), entry)
Cells(i + 1, entry - 38).Value = iVal
Next
i
Else
For
i = 1
To
130
iVal = Application.WorksheetFunction.CountIfs(sh.Range(
"I:I"
), Cells(i + 1, 1).Value, sh.Range(
"C:C"
), entry)
Cells(i + 1, entry + 15).Value = iVal
Next
i
End
If