Since you didn't provided sample dwg here is code that works with selected text without filtering. Let suppose all selected text has numerical values. To use this code move text entities aside or leave only this layer on.
(defun c:maxvaluetext ( / ss i lst)
(setq i -1 ss (ssget '((0 . "*text"))))
(cond
((and ss)
(while (< (setq i (1+ i)) (sslength ss))
(setq lst (cons (list (atof(cdr(assoc 1 (entget (ssname ss i))))) (ssname ss i)) lst))
)
(mapcar 'entdel (mapcar 'cadr (cdr (vl-sort lst '(lambda (x y) (> (car x)(car y)))))))
)
)
(princ)
)
Miljenko Hatlak

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.