
The world of VBA starts with the Visual Basic Editor (VBE). (setq NewStr$ (strcat (substr NewStr$ 1 (1- Cnt#)) Replace$ (substr NewStr$ (+ Cnt# FindLen#))) (setq Mid$ (substr NewStr$ Cnt# FindLen#)) (setq Loop t Cnt# 1 NewStr$ Str$ FindLen# (strlen Find$) ReplaceLen# (strlen Replace$)) (defun FindReplace: (Str$ Find$ Replace$ / Cnt# FindLen# Loop Mid$ NewStr$ ReplaceLen#) Returns: Returns Str$ with Find$ changed to Replace$ FindReplace: - Returns Str$ with Find$ changed to Replace$ Mid$ Mid2$ NewText$ Num# Replace$ SS& Text$) (defun FindReplaceAll (Find$ Replace$ / BlkEntName^ BlkEntType$ DimEntName^ DimEntType$ EntName^ EntType$ FindReplace: Returns: Updates Text, Mtext, Dimension and Attribute Block entities Syntax: (FindReplaceAll "old string" "new string") that have a Find$ string with a Replace$ string. FindReplaceAll - Changes Text, Mtext, Dimensions and Attribute Block entities (setq new_text (getstring T "NEW text to use: ")) (setq old_text (getstring T "OLD Text to replace (replace in this model/paper space and text case as entered): ")) (defun c:txtreplace( / old_text new_text) (note that this is about the only command line find and replace lisp I could find, everything else is with a pop up box) but if you only have short Dtexts to update it should work this best works on Dtext, when an Mtext string gets too long it stops processing it after so many characters. In the LISP below you'll need to modify C:txtreplace so that old_text and new_text are read from your spreadsheet rather than as an input - I don't have anything to hand that does that but others might be able to change this around, and you could have old_text and new_text as lists, just repeat the FindReplaceAll command until you have gone through the full list. I have copied a text find and replace LISP (C:txtreplace) which has limitations but you might be able to use this - call this LISP from the scriptwriter above and it -should- work You could try Lee Macs Script programme (or others) to process updating each file (I think this does it: ).
