Will skip revision letters I, O and Q. Works with number strings also.
I have one for up'ing revisions, but it is specific to a company title block. Not an easy thing to change if you did not write the code, sorry.
(defun UpRevisionString (String / tmpPos tmpStr tmpStr2 tmpStr3 EndStr tmpAddValue)
; Update to the new revision. A->B, Z->AA, AZ->BA, AZA->AZB
(setq tmpPos (strlen String))
(while (and (/= tmpPos 0) (= (setq tmpStr (substr String tmpPos 1)) "Z"))
(setq tmpPos (1- tmpPos))
(if tmpStr2
(setq tmpStr2 (strcat "A" tmpStr2))
(setq tmpStr2 "A")
)
)
(if (= tmpPos 0)
(repeat (1+ (strlen String))
(if EndStr
(setq EndStr (strcat EndStr "A"))
(setq EndStr "A")
)
)
(progn
(setq tmpStr3 (substr String 1 (1- tmpPOs)))
(if (or (= tmpStr "H") (= tmpStr "N") (= tmpStr "P"))
(setq tmpAddValue 2)
(setq tmpAddValue 1)
)
(setq tmpStr (chr (+ tmpAddValue (ascii tmpStr))))
)
)
(cond
(EndStr
EndStr
)
((and tmpStr tmpStr2 tmpStr3)
(strcat tmpStr3 tmpStr tmpStr2)
)
((and tmpStr tmpStr3)
(strcat tmpStr3 tmpStr)
)
)
)