+ Reply to Thread
Results 1 to 7 of 7

Alt + Enter when pressing enter in cell?

  1. #1
    Registered User
    Join Date
    08-19-2009
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    9

    Alt + Enter when pressing enter in cell?

    I'm trying to find a code which forces certain cells to do a line break (Alt+Enter) when you press enter in the cell. Anyone know how to make it, or where I can find one?

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Alt + Enter when pressing enter in cell?

    It is impossible to get code to run whilst a cell is being edited (without using Windows API calls anyway) and I would suggest it's a bad idea anyway - users are used to pressing Enter to leave a cell. You might consider using a textbox instead, or add a comment to the cell explaining that Alt+Enter is required.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    08-19-2009
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Alt + Enter when pressing enter in cell?

    The problem with a textbox is that it doesn't make the cell bigger. It overlaps other cells, and I need to avoid that from happening.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Alt + Enter when pressing enter in cell?

    Then I suggest you use a comment (or data validation message) to advise users to use Alt+Enter.

  5. #5
    Registered User
    Join Date
    08-19-2009
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Alt + Enter when pressing enter in cell?

    Well I added a comment now, though I came across another problem. The cells are merged and Alt + Enter doesn't seem to edit the row height automaticly while it does so in normal cells. Any ideas how that could be?

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Alt + Enter when pressing enter in cell?

    It's down to the fact that merged cells are an abomination.
    Try this tip.

  7. #7
    Registered User
    Join Date
    08-19-2009
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Alt + Enter when pressing enter in cell?

    Thank you, that worked .

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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