Insert alt enter into a cell or a column with defined comma counted

Kevincwk2000

Board Regular
Joined
Mar 23, 2008
Messages
82
Dear Sir,

I am looking for a code to insert alt-enter into a cell or a column with a defined comma count per line, saying 5

is

C1,C2,C3,C4,C5,C6,C7
C8,C9,C10,C11

want to change the cell(s) as

C1,C2,C3,C4,C5,
C6,C7,C8,C9,C10,
C11

thanks,
Kevin
 
Hi Mick,

I found a bug in the code.

WAS:-
C8,C84,C202,C206,C212,C215,C239,C241
C243,C244,C245,C291,C294,C341,C343,C344
C345,C367,C389,C391,C392,C393,C395,C439
C441

run the code will become:-
C8,C84,C202,C206,C212,
C215,C239,C241C243,C244,C245,
C291,C294,C341,C343,C344C345,
C367,C389,C391,C392,C393,
C395,C439C441

Highlighted in RED are the problems

thanks,
Kevin
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi, The reason is that, where you find this error, you do not have a comma to deliminate the individual values ,unless you have a different criteria for the delimination, or enter a comma at the end of each value, you will always get this result.
If all you values start with a "C", perhaps you could use that !
Mick
 
Upvote 0

Forum statistics

Threads
1,215,065
Messages
6,122,944
Members
449,095
Latest member
nmaske

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