JugglerJAF
Active Member
- Joined
- Feb 17, 2002
- Messages
- 297
- Office Version
- 365
- Platform
- Windows
I'm looking for a custom function that will take a long character string (for example: 1234ABCD5678EFGH in cell A1), and split it into chunks in column B, and have each chunk separated by spaces (but all in the same output column) with the number of characters in each chunk to be specified by the user.
For example, if the chunk size was 4, then the B1 would be "1234 ABCD 5678 EFGH", but if the chunk size was 7 then the B1 would be "1234ABC D5678EF GH".
The length of the initial text string could vary and as you can see in the "7" example above, it's not always going to divide into equal sized chunks.
I've been scratching my head over how to do this. I'm sure there is a way, but I can't think of it.
Any suggestions?
For example, if the chunk size was 4, then the B1 would be "1234 ABCD 5678 EFGH", but if the chunk size was 7 then the B1 would be "1234ABC D5678EF GH".
The length of the initial text string could vary and as you can see in the "7" example above, it's not always going to divide into equal sized chunks.
I've been scratching my head over how to do this. I'm sure there is a way, but I can't think of it.
Any suggestions?