by Anonymous on June 23rd, 2009

Anonymous

Question

Help answer this question below.

Entering data in excel: I want to have the cursor start in row A each time i reach the end of lenght of spreadsheet. For example; end of data is in row H. I want the cursor to automatically return to cell A afer entering data in row H and not go to row I.

  • Like
  • Report

Answers. 1 helpful answer below.

  • by Cyanotic Wasp on June 25th, 2009

    Cyanotic Wasp

    Column A, not "Row" A.

    Here is some code that I obtained from ozgrid.com several years ago and which you can place into the "Worksheet" code area for any worksheet in a workbook.

    The only other thing that is needed here is to name the allowable range that you will allow the cursor to move in.

    ==============================================
    ' From http://www.ozgrid.com/VBA/MiscVBA.htm
    ' 19-May-03 -- Using a Named Range to modify
    ' and control the allowable scroll area

    Private Sub Worksheet_Activate()
    Me.ScrollArea = "PERSONAL.xls!myrange"

    'To set back to normal use:
    'Me.ScrollArea = ""
    ' OR Scroll_At_Will

    Application.SendKeys "^{Home}"

    End Sub

    Sub Scroll_At_Will()
    Me.ScrollArea = ""
    End Sub

    ==============================================
    This code is in my Personal.XLS workbook file simply as sample code, which is why the reference to a named range (MyRange) in that workbook. You can place the code into any workbook you want, and just change the workbook and range name references to suit your application.

    The code is activated at the "Worksheet_Activate" area, which means that every time this worksheet is activated, the cursor movement range is restricted to "MyRange". If I want to change that, then I just have to run the macro "Scroll_at_will()" and the restriction is lifted.

    No comments. Post one | Permalink

Want to attach an image to your answer? Click here.

Did this answer your question? If not, then ask a new question or create a poll.

You're reading Entering data in excel: I want to have the cursor start in row A each time i reach the end of lenght of spreadsheet. For example; end of data is in row H. I want the cursor to automatically return to cell A afer entering data in row H and not go to row I.

Follow us on Facebook!

Related Ads

ANSWERBAG BUZZ

Placing the cursor at the start of a cell in excel
Return cursor in excel to the start cell
How to get the cursor to go to the start of a row after entering data in a cell
Code or macro excel for entering data
Cursor excel