lampel Posted August 26, 2015 Share 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. Link to comment Share on other sites More sharing options...
water Posted August 26, 2015 Share Posted August 26, 2015 Replace @CRLF with Chr(10). My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
lampel Posted August 26, 2015 Author Share 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) Link to comment Share on other sites More sharing options...
water Posted August 26, 2015 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
lampel Posted August 26, 2015 Author Share 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 .... Link to comment Share on other sites More sharing options...
water Posted August 26, 2015 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now