drelARCH Posted February 6, 2021 Share Posted February 6, 2021 (edited) Hello, Recently I came across this useful script (made by @Pat Stanford) and I would really like to use it as a way to replace outdated layer name in criteria for many my spreadsheet cells within one worksheet. Can this script work with multiple cells selected, or it only function with one cell at the time? And is there around maybe updated version of script to more recent software versions? Thanks. Here is a script: Var S1,S2,S3 :String; N1 ,N2,N3,N4,N5,N6,N7 :Integer; H1 :Handle; Begin S1:=StrDialog('Enter Substring to Find','Loc1'); S2:=StrDialog('Enter Substring to Replace With', 'Loc2'); H1:=GetTopVisibleWS; GetWSSelection(H1,N5,N5,N1,N2,N5,N3,N4,N5); For N5:=N1 to N3 do Begin For N6:=N2 to N4 do Begin GetWSCellFormula(H1,N5,N6,S3); N7:=Pos(S1,S3); If N7 <> 0 then Begin Delete(S3,N7,Len(S1)); Insert(S2,S3,N7); SetWSCellFormula(H1,N5,N6,N5,N6,S3); end; end; end; ClrMessage; END; Run(FindandReplaceInWorksheet); Edited February 6, 2021 by drelARCH 1 Quote Link to comment
drelARCH Posted February 6, 2021 Author Share Posted February 6, 2021 Never mind. It is working now as expected. I understand now what exactly to type in dialogues. And it works perfectly. Thanks for great script! 1 Quote Link to comment
Pat Stanford Posted February 7, 2021 Share Posted February 7, 2021 Nice to see that a script I original wrote in 2009 is still working for someone. :-) 2 Quote Link to comment
matteoluigi Posted February 17, 2022 Share Posted February 17, 2022 (edited) yeah, now i digged out that script, too. Incredible somehow, that there is no "find and replace"-command in Vectorworks-Worksheets ;-D. Like Excel without find-replace... such a pity, that you can't find & replace sub-rows (unfortunately technically unthinkable, imho) Edited February 17, 2022 by matteoluigi 2 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.