Results 1 to 4 of 4

VBA to Add carriage return in cell after x number of character

Threaded View

  1. #1
    Registered User
    Join Date
    12-06-2019
    Location
    Belfast, N. Ireland
    MS-Off Ver
    365
    Posts
    2

    VBA to Add carriage return in cell after x number of character

    I looking for vb at will format cells in a column, at 27 characters it should insert a carriage return, however this return should not be in the middle of a word, if the break were to fall in the middle of a word it would go to the previous space.


    So for example :

    This is just a sample line of text to show how I would like it formatted

    would change to the following :

    This is just a sample line
    of text to show how I would
    like it formatted

    Appreciate any help, I can get it to insert a return after x characters but only on the first occurance and cant work out to allow for not breaking words.

    Steve.
    Last edited by mbfg; 12-06-2019 at 06:58 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Expressing Carriage Return Character in a Formula
    By DobieMomPA in forum Excel General
    Replies: 4
    Last Post: 06-25-2010, 02:46 PM
  2. Carriage Return in cell
    By g48dd in forum Excel General
    Replies: 3
    Last Post: 12-28-2007, 02:24 AM
  3. [SOLVED] Carriage return character
    By alrastro in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-14-2006, 01:40 PM
  4. [SOLVED] Find max number of character and return cell address
    By ExcelMonkey in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-14-2006, 11:13 PM
  5. What are the character codes of a carriage return entered in a comment?
    By John Wirt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-03-2005, 04:01 PM
  6. [SOLVED] How to remove or replace a carriage return character in a cell?
    By Patty in forum Excel General
    Replies: 2
    Last Post: 07-26-2005, 02:05 PM
  7. Replies: 6
    Last Post: 03-23-2005, 11:06 PM
  8. [SOLVED] How do I add a carriage return into a cell in Excel?
    By pm in forum Excel General
    Replies: 3
    Last Post: 02-14-2005, 09:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1