Results 1 to 4 of 4

Thread: Navigation

  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Posts
    309
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Navigation

    Using Excel 2000. I have information in cells a1:a100 and b1:b100. My cursor is in cell b100 which has data in it. In cells b1:b100, some cells have "NO DATA" in them. I'm looking for a "keyboard shortcut" to get from b100 to b1. I know I can use the name box but is there a key combination that does it.

    Thanks,

    Don

    P.S. - If I use Ctrl+ up arrow, it just goes to the next blank cell in the column.

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Navigation

    You could create a Sub procedure like the one below and assign it to a shortcut key:

    <pre>Public Sub GoToTop()
    Cells(1, Selection.Column).Select
    End Sub
    </pre>

    Legare Coleman

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Navigation

    As Legare said, you can attach a shortcut key to a macro. The one he proposed does the job, but there are all kind of variations to the theme. Here you have a macro, that, no matter where the range is located (e.g. it can be b101:b200"), selects the first cell with data (e.g. b101) if this cell is the first cell in that column which is not empty. Actually the End property of the Activecell emulates the operation Ctrl + ArrowKey. You can go in other directions, using xlUp, xlToLeft, xlToRight and xlDown.
    e.g. if you want to go to the last non-empty cell in column A, you can start from the bottom of the worksheet and go up, as long as A65536 is empty:
    Range("A65536").End(xlUp).Select


    Sub GotoTopofRange()
    Dim i As Integer
    Do
    ActiveCell.End(xlUp).Select
    i = i + 1
    Loop Until ActiveCell.Row = 1
    If IsEmpty(ActiveCell) And i > 1 Then
    ActiveCell.End(xlDown).Select
    End If
    End Sub

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia, Australia
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Navigation

    Ctrl-Home will take you to A1, just a hop to B1 then.

Posting Permissions

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