+ Reply to Thread
Results 1 to 11 of 11

Entering Data

  1. #1
    Programming Cells
    Guest

    Entering Data

    I want to be able to enter numbers into cells A1 through A10. Once I've
    reached cell A10 I want it to automatically jump to Cell B1. How can I
    accomplish this?

  2. #2
    Registered User
    Join Date
    07-25-2005
    Posts
    62
    Use this code. This is the SelectionChange event.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Address = "$A$10" Then
    Range("B10").Select
    End If
    End Sub

    or to do it for every column

    If Target.Row = 10 then
    Cells(1,Target.Column +1).Select
    End If
    Last edited by TommySzalapski; 07-26-2005 at 04:34 PM.

  3. #3
    jjk
    Guest

    Re: Entering Data

    I guess this is what you are looking for.
    I have hardcoded it for selection of row 11. You can play around with
    that.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    If Target.Row = 11 Then
    Target.Offset(1 - Target.Row, 1).Select
    End If

    End Sub


  4. #4
    Programming Cells
    Guest

    Re: Entering Data

    Do I just enter this code into Cell A11???

    "jjk" wrote:

    > I guess this is what you are looking for.
    > I have hardcoded it for selection of row 11. You can play around with
    > that.
    >
    > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    >
    > If Target.Row = 11 Then
    > Target.Offset(1 - Target.Row, 1).Select
    > End If
    >
    > End Sub
    >
    >


  5. #5
    Tom Ogilvy
    Guest

    Re: Entering Data

    Chip Pearson's page on Events
    http://www.cpearson.com/excel/events.htm

    you would place it in the Sheet module of the sheet where you want the
    activity. right click on the sheet tab and select view code.

    --
    Regards,
    Tom Ogilvy

    "Programming Cells" <[email protected]> wrote in
    message news:[email protected]...
    > Do I just enter this code into Cell A11???
    >
    > "jjk" wrote:
    >
    > > I guess this is what you are looking for.
    > > I have hardcoded it for selection of row 11. You can play around with
    > > that.
    > >
    > > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    > >
    > > If Target.Row = 11 Then
    > > Target.Offset(1 - Target.Row, 1).Select
    > > End If
    > >
    > > End Sub
    > >
    > >




  6. #6
    Nigel
    Guest

    Re: Entering Data

    No. You enter into the code sheet behind the worksheet. Right-click on the
    worksheet tab and choose View Code, the editor opens, and paste the code
    there.

    --
    Cheers
    Nigel



    "Programming Cells" <[email protected]> wrote in
    message news:[email protected]...
    > Do I just enter this code into Cell A11???
    >
    > "jjk" wrote:
    >
    > > I guess this is what you are looking for.
    > > I have hardcoded it for selection of row 11. You can play around with
    > > that.
    > >
    > > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    > >
    > > If Target.Row = 11 Then
    > > Target.Offset(1 - Target.Row, 1).Select
    > > End If
    > >
    > > End Sub
    > >
    > >




  7. #7
    Programming Cells
    Guest

    Re: Entering Data

    What if I want to save the document and go back into it another time.

    How do I maintain the source code.

    Currently when I exit and go back in the source does not work anymore.

    "TommySzalapski" wrote:

    >
    > Use this code. This is the SelectionChange event.
    >
    > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    > If Target.Address = "$A$10" Then
    > Range("B10").Select
    > End If
    > End Sub
    >
    > or to do it for every column
    >
    > If Target.Row = 10 then
    > Cells(1,Taget.Column +1).Select
    > End If
    >
    >
    > --
    > TommySzalapski
    > ------------------------------------------------------------------------
    > TommySzalapski's Profile: http://www.excelforum.com/member.php...o&userid=25561
    > View this thread: http://www.excelforum.com/showthread...hreadid=390277
    >
    >


  8. #8
    Tom Ogilvy
    Guest

    Re: Entering Data

    Did you save the workbook after you added the code?

    --
    Regards,
    Tom Ogilvy

    "Programming Cells" <[email protected]> wrote in
    message news:[email protected]...
    > What if I want to save the document and go back into it another time.
    >
    > How do I maintain the source code.
    >
    > Currently when I exit and go back in the source does not work anymore.
    >
    > "TommySzalapski" wrote:
    >
    > >
    > > Use this code. This is the SelectionChange event.
    > >
    > > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    > > If Target.Address = "$A$10" Then
    > > Range("B10").Select
    > > End If
    > > End Sub
    > >
    > > or to do it for every column
    > >
    > > If Target.Row = 10 then
    > > Cells(1,Taget.Column +1).Select
    > > End If
    > >
    > >
    > > --
    > > TommySzalapski
    > > ------------------------------------------------------------------------
    > > TommySzalapski's Profile:

    http://www.excelforum.com/member.php...o&userid=25561
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=390277
    > >
    > >




  9. #9
    Programming Cells
    Guest

    Re: Entering Data

    yes I did

    "Tom Ogilvy" wrote:

    > Did you save the workbook after you added the code?
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Programming Cells" <[email protected]> wrote in
    > message news:[email protected]...
    > > What if I want to save the document and go back into it another time.
    > >
    > > How do I maintain the source code.
    > >
    > > Currently when I exit and go back in the source does not work anymore.
    > >
    > > "TommySzalapski" wrote:
    > >
    > > >
    > > > Use this code. This is the SelectionChange event.
    > > >
    > > > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    > > > If Target.Address = "$A$10" Then
    > > > Range("B10").Select
    > > > End If
    > > > End Sub
    > > >
    > > > or to do it for every column
    > > >
    > > > If Target.Row = 10 then
    > > > Cells(1,Taget.Column +1).Select
    > > > End If
    > > >
    > > >
    > > > --
    > > > TommySzalapski
    > > > ------------------------------------------------------------------------
    > > > TommySzalapski's Profile:

    > http://www.excelforum.com/member.php...o&userid=25561
    > > > View this thread:

    > http://www.excelforum.com/showthread...hreadid=390277
    > > >
    > > >

    >
    >
    >


  10. #10
    Registered User
    Join Date
    07-25-2005
    Posts
    62
    Go to tools -> Macro -> Security and change the security level from high to medium. Reopen your file and click Enable when it asks about macros. If that does not work than you have somehow deleted your code. And I apologize for the error in my first post. Those numbers should have been 11, not 10. Thank for the correction jjk.
    Last edited by TommySzalapski; 07-26-2005 at 04:34 PM.

  11. #11
    Programming Cells
    Guest

    Re: Entering Data

    no problem. i found that i did not have the complete vb authorization
    package installed.

    This works great. Thanks.

    Can I also put in a macro so that if I do not reach the end of the cell I
    can manually call a macro that forces me to the next beginning cell?

    "TommySzalapski" wrote:

    >
    > Go to tools -> Macro -> Security and change the security level from high
    > to medium. Reopen your file and click Enable when it asks about macros.
    > If that does not work than you have somehow deleted your code. And I
    > apologize for the error in my first post. Those numbers should have
    > been 11, not 10. Thank for the correction jjk.
    >
    >
    > --
    > TommySzalapski
    > ------------------------------------------------------------------------
    > TommySzalapski's Profile: http://www.excelforum.com/member.php...o&userid=25561
    > View this thread: http://www.excelforum.com/showthread...hreadid=390277
    >
    >


+ 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