Consulting

Results 1 to 3 of 3

Thread: How to jump between cells

  1. #1
    VBAX Regular
    Joined
    Mar 2006
    Posts
    15
    Location

    How to jump between cells

    If i want to be able to jump in an specific way between different cells using Tab on the keyboard, how is this done? I want to jump from cell A1 directly to C1, then from C1 to A2, from A2 to C2 and so on to cell C50 and then up to E1 to G1, E2 to G2 and so on....

  2. #2
    VBAX Regular
    Joined
    Apr 2006
    Posts
    32
    Location
    By default, Excel marks all cells as "locked". See "Format", "Cells", "Protection". Highlight the cells you want to "jump to", using CTRL/Left Click on each one, right click on one of highlighted cells, choose "Format Cells", "Protection", remove the checkmark in "Lock Cells", click "OK". Click on "Tools", "Protection", "Protect Sheet". Choose a password if you wish, remove the checkmark from "Select locked cells", leaving the checkmark in "Select unlocked cells", click "OK".

    Hope this helps.

  3. #3
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Easier to do from a form
    or try this in the code for the sheet you wish to use tab on except it uses the enter key too:

    [vba]
    Dim lastcell As String
    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Select Case lastcell
    Case "a1"
    Range("a2").Select
    lastcell = "a2"
    Case "a2"
    Range("a3").Select
    lastcell = "a3"
    Case "a3"
    Range("b1").Select
    lastcell = "b1"
    Case "b1"
    Range("c1").Select
    lastcell = "c1"
    Case "c1"
    Range("d1").Select
    lastcell = "d1"
    Case "d1"
    Range("b3").Select
    lastcell = "b3"
    Case Else
    Range("a1").Select
    lastcell = "a1"
    End Select
    End Sub
    [/vba]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •