+ Reply to Thread
Results 1 to 4 of 4

goto function

Hybrid View

  1. #1
    Registered User
    Join Date
    06-13-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Talking goto function

    Hi there,

    Hope someone can help. I've been looking for a while now but can't seem to find what i'm looking for.

    Basically I need cell B16 to jump to cell B2 automatically once the cell is active.

    I have a sheet like this
    B2 1
    B3 3
    B4 4 and so on.... and when i get to

    B16 I don't want to enter anything but as soon as I hit enter on cell B15 and B16 becomes active, I want it to jump back to B2 so i can start the process again and enter new values.

    Any ideas?

    Many thanks
    Last edited by jbrandon; 06-13-2010 at 12:35 PM. Reason: solved in a flash

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: goto function

    Try this
    Option Explicit
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Address = "$B$16" Then Cells(2, 2).Select
    End Sub
    Copy the Excel VBA code
    Select the workbook in which you want to use the code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    In the Project Explorer, find your workbook, and open the list of Microsoft Excel Objects
    Right-click on the ThisWorkbook object, and choose View Code
    Where the cursor is flashing, choose Edit | Paste
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-13-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: goto function

    My word, I've been searching for this for hours.

    Thank you so much roy!

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: goto function

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

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