delete blank lines in excel cell - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: delete blank lines in excel cell (/Thread-delete-blank-lines-in-excel-cell) |
delete blank lines in excel cell - QAVA - 12-06-2012 Excel cell(1,2) has data with blank lines as: " vb is hard language. test data. test vb. " I want to change to without blank lines as " "vb is hard language. test data test vb" Below code is not working. Please please help. ---------- Code: Set ExcelApp = createobject("Excel.Application") RE: delete blank lines in excel cell - diya - 12-07-2012 Code: Set ExcelApp = createobject("Excel.Application") i dont if this works coz iam not able to create a excel with blank values..try this if not sorry RE: delete blank lines in excel cell - elango87 - 12-07-2012 @Diya, You have type the first line in the cell and press Shift+enter to get to the next line. @QAVA I broke my head for the past two days trying to find a solution. The newline character in excel is recognized as some special character. I tried using split function which dint help.It goes something like this, Code: Str = Split(CellValue, vbnewline) I did try many other things but nothing helped. Finally i wrote the contents of the cell in to a text file and tried reading from it. I am half successful in doing it. I was able to remove the spaces between the lines but at the end of the line, some special character it getting added. I am not able to fix it. Here is the code... hope someone will be able to fix it... --- Code: Dim oExcel, oWbook, oSheet Hope this will help you. Thanks, Elango |