This will only allow data to be entered in B1:B100 when less than 50 cells contain data. Once the 51st entry is attempted, the formula will return FALSE and prevent the data from be entered.
If I were doing this, I'd change the message so that it said something like "Too Many Entries In Range."
That's a lot less confusing that the standard "A user has restricted values that can be entered into this cell.'
That message is "cell specific" when you asking the validation to be range specific.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.