+ Reply to Thread
Results 1 to 7 of 7

VBA for Line Break (Alt- Enter)

  1. #1
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    VBA for Line Break (Alt- Enter)

    Hi all,
    I was wondering whether there is a VBA which format multiple cells to contain a line break. What I need is as follows:

    I would like all the cells found in column D (of a Sheet 1) to have the following format: a line break (similar to Alt-Enter), text, another line Break (similar to Alt-Enter). Example, cell D1, would look like this:

    Alt-Enter
    text
    Alt-Enter.

    I would like this format for all cells in column D.

    Is there a VBA which makes this possible or any work around?

    Thanks a lot everyone

    Keibri

  2. #2
    Registered User
    Join Date
    09-10-2014
    Location
    Matrix
    MS-Off Ver
    2010
    Posts
    70

    Re: VBA for Line Break (Alt- Enter)

    Keibri, yes you can. Just use ascii.
    Please Login or Register  to view this content.
    Then in the loop you can modify your cells:
    Please Login or Register  to view this content.
    Last edited by michson; 05-28-2015 at 05:00 AM.
    (*) Reputation points appreciated.
    excelbs.tk

  3. #3
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: VBA for Line Break (Alt- Enter)

    Thanks a lot michson!

    Pardon my ignorance, cause I am a noob when it comes to VBA, Do I join the two codes together?

    Thanks a lot and apologies for the bother!

  4. #4
    Registered User
    Join Date
    09-10-2014
    Location
    Matrix
    MS-Off Ver
    2010
    Posts
    70

    Re: VBA for Line Break (Alt- Enter)

    Keibri, you can use just the second code to modify your data.

  5. #5
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: VBA for Line Break (Alt- Enter)

    Thanks a lot Michson! It worked !

  6. #6
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: VBA for Line Break (Alt- Enter)

    Just for fun.. without a loop..

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: VBA for Line Break (Alt- Enter)

    Thanks Apo,

    It worked brillianty ! Thanks everyone

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Enter Line-Break [Alt + Enter] at specific location
    By jewelsharma in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-27-2014, 12:23 AM
  2. [SOLVED] VBA to insert line break (Alt+Enter)
    By TextMonkey in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-12-2014, 01:18 PM
  3. ALT+ENTER = line break
    By Nyla in forum Excel General
    Replies: 5
    Last Post: 05-23-2006, 05:45 PM
  4. [SOLVED] Why can't I get 'alt enter' to create a line break in Excel?
    By babbott in forum Excel General
    Replies: 3
    Last Post: 05-08-2006, 07:25 PM
  5. How do I enter a line break within a cell?
    By Striving for efficiency in forum Excel General
    Replies: 4
    Last Post: 11-17-2005, 04:15 PM

Tags for this Thread

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