A little add on not hard codedfor layer name.
(defun c:LC ( / layname )
(setq layname (vla-get-layer (vlax-ename->vla-object (car (entsel)))))
(if (setq ss (ssget "_X" (list (cons 8 layname))))
(Alert (strcat "\nTotal : " (rtos (sslength ss) 2 0) " entities \n\nIn Layer : " layname))
(Alert (strcat "\nNo entities in Layer : " layname))
)
(princ)
)
(c:lc)
(vla-get-Layers doc) this gets the list of layer names from the layer table, not objects within that layer.