excel - Preserve line breaks when inserting/pasting from cell to word -


i have following code

dim cant integer dim tex string dim max integer dim total integer dim final integer final = 1 cant = 1 max = 200 ' amount of character go have divide, visual basic allows 250. in case 200 description = range("e1").value 'sheets("programas").cells(1, 1).value. have string > 250 caracters, divides in cant = 200. total = len(description) ' have total characters of string.  while total > (cant) * max     msgbox total     ' "while" divides string in "cant = 200", example 1200 characters, "while" divides string in 6 parts.     wdfind             .clearformatting             .matchcase = false             .matchwholeword = false              .text = "here" ' shearch [1] , replace "cant = 200"             tex = mid(description, final, max) ' content "cant = 200" characters, actual             .replacement.text = tex & "here"  ' replace "cant = 200" , add [1],for next "cant = 200" characters             cant = cant + 1             final = max * (cant - 1) ' have character actual divide in "cant = 200", example ---> 0 position ..... "190 characteres" other 10 characters ------ final = 200 -------- 201 character -----> next "cant = 200"             .execute replace:=2            ' msgbox tex & "here"     end loop  wdfind         .clearformatting         .matchcase = false         .wraptext = true         .matchwholeword = false         .text = "here"         tex = mid(description, final, total)         .replacement.text = tex         .execute replace:=2 end 

i looking preserve newline/breaks in cell description. there way preserve it?


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -