I am trying to count how many times a number (Num) on one tab appears in a specified column of another tab. The Num is a variable, it is part of a do while loop where the cell itself changes and the value in the cell changes based on user input. Therefore, I have no way of knowing what the CountIf is actually searching for and need it to search for a variable.
I tried setting Num as Range and Double for the below:
WorksheetFunction.CountIf(Range("C:C"), Num) = b
But I keep getting "Assignment to constant not permitted". Everything I've searched for on CountIf has a specific word in the search part, is it even possible to use a variable? I'm not sure what part I'm screwing up, any help would be greatly appreciated!
Thank you!
I tried setting Num as Range and Double for the below:
WorksheetFunction.CountIf(Range("C:C"), Num) = b
But I keep getting "Assignment to constant not permitted". Everything I've searched for on CountIf has a specific word in the search part, is it even possible to use a variable? I'm not sure what part I'm screwing up, any help would be greatly appreciated!
Thank you!