Create Excel Formula / VBA to add characters into text string
£10-20 GBP
Cancelado
Publicado hace más de 7 años
£10-20 GBP
Pagado a la entrega
I need to create a formula or function which will:
replace the last space before the nth character (e.g. 50th character) in a text string in an Excel cell with a specified character (e.g. "|") excel
For example the text string is
CITROËN: 7700618657, CITROËN: 7700663550, FIAT: 4176840, FIAT: 4420507, INNOCENTI: 4176840, LANCIA: 4176840, LANCIA: 4420507, PEUGEOT: 0816.16, PEUGEOT: 081616, PEUGEOT: 7700618657, RENAULT: 7700618657, RENAULT: 7701348801, ZASTAVA: 4176840, ACDelco: AB11001, AE: TB114, BANDO: 116ZA18, BANDO: 116ZA19, BOSCH: 1 987 949 011, BOSCH: 9 144 161 116
The result of the formula or function is:
CITROËN: 7700618657, CITROËN: 7700663550, FIAT:|4176840, FIAT: 4420507, INNOCENTI: 4176840,|LANCIA: 4176840, LANCIA: 4420507, PEUGEOT:|0816.16, PEUGEOT: 081616, PEUGEOT: 7700618657,|RENAULT: 7700618657
Basically it splits the text into into banks of no more than 50 characters without splitting words.
The function must allow me to edit the number of characters (50) and the character to insert (|). Formula is ok, I have never used VBA so will need instruction on how to add the function.
This should be very simple task for anyone with VBA knowledge.