Insert a line break after every 42 characters

Rajkiran557

New Member
Joined
Jun 21, 2014
Messages
10
Hi All,


I need a formula to insert a line break after every 42 characters in a cell , example if there is 266 characters in a cell there should be 6(266/42)line breaks.


=REPLACE(REPLACE(A1,42,0,CHAR(10)),84,0,CHAR(10))


I tried this but i am not sure how to get the start num to change to 126,168 and so on


Any help is highly appreciated


Thanks
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi All,


I need a formula to insert a line break after every 42 characters in a cell , example if there is 266 characters in a cell there should be 6(266/42)line breaks.


=REPLACE(REPLACE(A1,42,0,CHAR(10)),84,0,CHAR(10))


I tried this but i am not sure how to get the start num to change to 126,168 and so on
I am not sure you will be able to do this with a formula, but there is a VBA coded method available, see my mini-blog article here...

<!-- title / author block -->Wrap Text On Spaces Up To A Maximum Number Of Characters Per Line
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,233
Members
449,092
Latest member
SCleaveland

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top