![]() |
write a macro to input data
I want to write a macro where I can input a number, move to the next cell,
input another number, move to the next cell, etc. for 9 numbers. After 9 numbers I want the cursor to go down and to the first column in the next row so I can do the same thing again. |
write a macro to input data
Setup in Tools - Edit tab - Move in Direction so that the cursor will move
to the right when you hit enter. That will produce the moving to the right part of what you want. The following macro will move the cursor to the A column of the next row whenever anything is entered in Column I. Note that this is a Worksheet_Change event macro and must be placed in the sheet module of the sheet in which you want this to happen. To access that module, right-click on the sheet tab of that sheet, select View Code, and paste this macro into that module. Click on the "X" in the top right corner of the screen to return to your sheet. HTH Otto Private Sub Worksheet_Change(ByVal Target As Range) If IsEmpty(Target.Value) Then Exit Sub If Target.Column = 9 Then _ Cells(Target.Row + 1, 1).Select End Sub "JPreeshl" wrote in message ... I want to write a macro where I can input a number, move to the next cell, input another number, move to the next cell, etc. for 9 numbers. After 9 numbers I want the cursor to go down and to the first column in the next row so I can do the same thing again. |
write a macro to input data
Unless you are dead set to have a macro do this, you can accomplish the same
from the keyboard. After each entry hit the Tab until the ninth entry, for the ninth entry hit Enter. HTH Regards, Howard "JPreeshl" wrote in message ... I want to write a macro where I can input a number, move to the next cell, input another number, move to the next cell, etc. for 9 numbers. After 9 numbers I want the cursor to go down and to the first column in the next row so I can do the same thing again. |
All times are GMT +1. The time now is 06:14 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com