Reputation: 33
Code: VBA
Sheets("Facebook").Activate
catcount(1) = Application.WorksheetFunction.CountIf(cndtnltrnsfr.Col_Letter(posval(1)) & "2:" & cndtnltrnsfr.Col_Letter(posval(1)) & emptyRow & "," & chr(34) & cat(1) & chr(34))
MsgBox catcount(1)
catcount(1)
: an array in which the number of times a category is occurring is stored
posval(1)
: an array which stores the position of a specific value
cat(1)
: category
It is giving an error
Argument not optional!
and highlighting .Countif
.
Upvotes: 0
Views: 42
Reputation: 10226
The WorksheetFunction.CountIf method takes 2 arguments and you only have one in this long concatenation :
cndtnltrnsfr.Col_Letter(posval(1)) & "2:" & cndtnltrnsfr.Col_Letter(posval(1)) & emptyRow & "," & chr(34) & cat(1) & chr(34)
Maybe you should change this :
& "," &
to this :
,
I can't answer more with what you have asked and shown.
Upvotes: 1