Hi,
I have a long texts in a specific column "B",
For each row, I need to split the text in multiple line (inside the same row: ALT + ENTER) after a fixed number of characters.
it's like when I wrap text
I need to use VBA si I found the code below in the web but it's not working
Help me please.
I have a long texts in a specific column "B",
For each row, I need to split the text in multiple line (inside the same row: ALT + ENTER) after a fixed number of characters.
it's like when I wrap text
I need to use VBA si I found the code below in the web but it's not working
Help me please.
Code:
[/FONT][/COLOR]Sub[FONT=inherit] Sample()[/FONT] [COLOR=blue][FONT=inherit]Dim[/FONT][/COLOR] doc [COLOR=blue][FONT=inherit]As[/FONT][/COLOR] Document
[COLOR=blue][FONT=inherit]Set[/FONT][/COLOR] doc = ActiveDocument
[COLOR=blue][FONT=inherit]For[/FONT][/COLOR] i = doc.Range.Characters.[COLOR=blue][FONT=inherit]Count[/FONT][/COLOR] [COLOR=blue][FONT=inherit]To[/FONT][/COLOR] 1 [COLOR=blue][FONT=inherit]Step[/FONT][/COLOR] -1
[COLOR=blue][FONT=inherit]If[/FONT][/COLOR] i [COLOR=blue][FONT=inherit]Mod[/FONT][/COLOR] 80 = 0 [COLOR=blue][FONT=inherit]Then[/FONT][/COLOR]
doc.Range.Characters(i) = doc.Range.Characters(i) & vbNewLine
[COLOR=blue][FONT=inherit]End[/FONT][/COLOR] [COLOR=blue][FONT=inherit]If[/FONT][/COLOR]
[COLOR=blue][FONT=inherit]Next[/FONT][/COLOR]
[COLOR=blue][FONT=inherit]End[/FONT][/COLOR] [COLOR=blue][FONT=inherit]Sub
[/FONT][/COLOR][COLOR=blue][FONT=inherit]
[/FONT][/COLOR]
[COLOR=blue][FONT=inherit]