lampel 0 Posted August 26, 2015 Hello all,i have a single excel cell with A very long string in it , ex: "C1 C2 C3 C4 C5 C6 C7 ..............C2000" i want to start a new line within the same cell every 20 "CXX"i have tried using:For $i=1 to $stringLength _StringInsert($MyString,@CRLF,20*$i) Nextbut @CRLF is entered as a string and not as a command.i know its a beginner question and i have searched for an answer and could not find one.Thanks lampel. Share this post Link to post Share on other sites
water 1,972 Posted August 26, 2015 Replace @CRLF with Chr(10). My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiiCal (2019-01-22 - Version 0.1.0.0) - Download - General Help & SupportExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Share this post Link to post Share on other sites
lampel 0 Posted August 26, 2015 thank you Water its working.small follow up question :how can i detect where to insert the new line so it wont break the line in the middle of the "CXX"ex : "c1 c2 c3 c4 c5 c6" ----> "c1 c2 c3 Chr(10) c4 c5 c6" (GOOD) "c1 c2 c3 c4 c5 c6" ----->"c1 c2 cChr(10)3 c4 c5 c6" (BAD) Share this post Link to post Share on other sites
water 1,972 Posted August 26, 2015 This should give you an idea:$iMaxlen = 10 $sString = "c1 c2 c3 c4 c5 c6" $sString = StringReplace(StringLeft($sString, $iMaxLen), " ", Chr(10), -1) & StringMid($sString, $iMaxLen + 1) ConsoleWrite($sString & @CRLF) My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiiCal (2019-01-22 - Version 0.1.0.0) - Download - General Help & SupportExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Share this post Link to post Share on other sites
lampel 0 Posted August 26, 2015 hi water ,That's not just an idea that's the whole solution thank u so much ! The things you do in sec takes me like few hours .... Share this post Link to post Share on other sites
water 1,972 Posted August 26, 2015 The longer you use AutoIt the better and faster you will get My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiiCal (2019-01-22 - Version 0.1.0.0) - Download - General Help & SupportExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Share this post Link to post Share on other sites