Results 1 to 3 of 3

[SOLVED] Return alt-enter when enter is pressed in a specific cell

Threaded View

  1. #1
    Registered User
    Join Date
    02-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question [SOLVED] Return alt-enter when enter is pressed in a specific cell

    I have a spreadsheet where the user is supposed to enter text into a specific cell. That text may be a single sentence, or it may be several paragraphs. I want Excel to convert the enter key to a carriage return and cause the cursor to stay in the same cell.

    I have something kind of working like I want, but there are still some issues:
    private sub worksheet_change(byval Target as Range)
    Foo
    If Target.address = Range("Description").address then
    Range("Description").Select
    Application.sendkeys "{F2}%{ENTER}"
    End if
    end sub
    This will add the enter like I want, but exiting out of it is cumbersome; you have to press enter one last time, then escape to jump out of the worksheet_change sub (if you just press escape, you loose the last line).

    I'd like to have the Tab key jump out, or have the escape key work without having to press the proceeding enter.

    Anyone got a better method?
    Last edited by bigsteve; 04-17-2013 at 10:22 AM. Reason: solved my own problem

Thread Information

Users Browsing this Thread

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

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