+ Reply to Thread
Results 1 to 4 of 4

Keyboard shortcut to get to the next changing text in a column

Hybrid View

  1. #1
    Registered User
    Join Date
    03-03-2011
    Location
    Utah, USA
    MS-Off Ver
    Excel 2007
    Posts
    26

    Keyboard shortcut to get to the next changing text in a column

    is there a keyboard shortcut to reach to the next changing text in a column. For example:
    if I have the following data in column A:
    X
    X
    X
    Y
    Y
    Y
    Y
    Z
    Z
    Z

    How to do I get from X at top (A2) to first instance of Y and then first instance of Z with keyboard shortcut?

    Thanks,

  2. #2
    Forum Contributor Dave H9's Avatar
    Join Date
    03-10-2011
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    418

    Re: Keyboard shortcut to get to the next changing text in a column

    I don't think there is a shortcut for this, only last used cell in range.

    Dave H
    - Mark your post [SOLVED] if it has been answered satisfactorily, by editing your original post using advanced mode.
    - Thank those that provided useful help, its nice and its very well appreciated...use the star on the lower left of the post

  3. #3
    Registered User
    Join Date
    03-03-2011
    Location
    Utah, USA
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Keyboard shortcut to get to the next changing text in a column

    Thanks Dave...but I have seen it somewhere, stored it in a file and lost the file!

  4. #4
    Forum Contributor Dave H9's Avatar
    Join Date
    03-10-2011
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    418

    Re: Keyboard shortcut to get to the next changing text in a column

    Hi Helal,

    After a bit of searching I have found you a solution.

    Open the code window and put this in the Workbook object -

    Option Explicit
    Private Sub Workbook_Open()
    Application.OnKey "^m", "nxt_differ" ' the ^m is the shortcut ie Ctrl + m
    End Sub
    Insert a new module and put this in -

    Sub nxt_differ()
    Dim cell1 As String
    Dim cell2 As String
    
    startpoint:
    cell1 = ActiveCell.Value
    ActiveCell.Offset(1, 0).Select
    cell2 = ActiveCell.Value
    If cell1 = "" Then
        Exit Sub
    End If
    If cell1 = cell2 Then
        GoTo startpoint
    Else
        Exit Sub
    End If
    
    End Sub
    Hope that is the solution you are after

    Dave H

+ 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