+ Reply to Thread
Results 1 to 4 of 4

Auto Alt+Enter in some cells

Hybrid View

  1. #1
    Registered User
    Join Date
    11-16-2008
    Location
    Dubai
    Posts
    73

    Unhappy Auto Alt+Enter in some cells

    Hi everyone....


    I have created a large worksheet for people to fill in, what i would like to do is for specific cells when the user hits enter, the equivilent of Alt+enter is executed so they move to a new line in the same cell.

    1) im not sure if we can enable this in VB???
    2) i would like this to happen for only a selection of cells say B10 D5 and E15 and the rest the normal enter event occures....

    can anyone help???

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Auto Alt+Enter in some cells

    Try this:
    Private Sub Worksheet_Change(ByVal Target As Range)
        With Target
            If .Count > 1 Then Exit Sub
            If Not Intersect(.Cells, Range("B10,D5,E15")) Is Nothing Then
                If .HasFormula Then
                    Application.EnableEvents = False
                    .FormulaArray = .Formula
                    Application.EnableEvents = True
                End If
            End If
        End With
    End Sub
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    11-16-2008
    Location
    Dubai
    Posts
    73

    Re: Auto Alt+Enter in some cells

    Thanks,

    I dont seem to get the result im after, im not sure what this code is executing?

    when i hit return in those cells it just drops to the next cell?

    nick

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Auto Alt+Enter in some cells

    It does, after converting the entry to an array formula.

+ 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