#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Auto return

I want to be able to go automate after entering data in the last cell in a
row to then go back to the beginning of the next line?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Auto return

Put this in worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < Cells.Columns.Count Then
Exit Sub
Else
i = Target.Row + 1
Cells(i, 1).Select
End If
End Sub

REMEMBER worksheet code, not a standard module
--
Gary's Student
gsnu200707


"Richo" wrote:

I want to be able to go automate after entering data in the last cell in a
row to then go back to the beginning of the next line?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Auto return

Hi

Unless the user wants to use the whole row of 256 columns before jumping
to the next line, wouldn't they need to insert a value equal to their
last column number, rather than using
Cells.Columns.Count

If Target.Column < Cells.Columns.Count Then


Cells.Columns.Count always returns 256 (in XL2003 and lower)

--
Regards

Roger Govier


"Gary''s Student" wrote in
message ...
Put this in worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < Cells.Columns.Count Then
Exit Sub
Else
i = Target.Row + 1
Cells(i, 1).Select
End If
End Sub

REMEMBER worksheet code, not a standard module
--
Gary's Student
gsnu200707


"Richo" wrote:

I want to be able to go automate after entering data in the last cell
in a
row to then go back to the beginning of the next line?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Auto return

But Roger, the OP specifically want the auto-return after data was entered in
the last cell in the row. Usually the last cell in a row is the cell in
column 256 (column IV) I used Cells.Columns.Count in case the OP was using
Excel 2007.
--
Gary's Student
gsnu200707


"Roger Govier" wrote:

Hi

Unless the user wants to use the whole row of 256 columns before jumping
to the next line, wouldn't they need to insert a value equal to their
last column number, rather than using
Cells.Columns.Count

If Target.Column < Cells.Columns.Count Then


Cells.Columns.Count always returns 256 (in XL2003 and lower)

--
Regards

Roger Govier


"Gary''s Student" wrote in
message ...
Put this in worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < Cells.Columns.Count Then
Exit Sub
Else
i = Target.Row + 1
Cells(i, 1).Select
End If
End Sub

REMEMBER worksheet code, not a standard module
--
Gary's Student
gsnu200707


"Richo" wrote:

I want to be able to go automate after entering data in the last cell
in a
row to then go back to the beginning of the next line?




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Auto return

Hi

Reading the OP's post literally, you are absolutely right.
I had assumed (perhaps wrongly) that he had data stretching across maybe
a dozen or so columns, and wanted to return to the beginning of the next
line after entering the last of "his" row of data.

Shows how we can all interpret a question quite differently <bg

--
Regards

Roger Govier


"Gary''s Student" wrote in
message ...
But Roger, the OP specifically want the auto-return after data was
entered in
the last cell in the row. Usually the last cell in a row is the cell
in
column 256 (column IV) I used Cells.Columns.Count in case the OP was
using
Excel 2007.
--
Gary's Student
gsnu200707


"Roger Govier" wrote:

Hi

Unless the user wants to use the whole row of 256 columns before
jumping
to the next line, wouldn't they need to insert a value equal to their
last column number, rather than using
Cells.Columns.Count

If Target.Column < Cells.Columns.Count Then


Cells.Columns.Count always returns 256 (in XL2003 and lower)

--
Regards

Roger Govier


"Gary''s Student" wrote in
message ...
Put this in worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < Cells.Columns.Count Then
Exit Sub
Else
i = Target.Row + 1
Cells(i, 1).Select
End If
End Sub

REMEMBER worksheet code, not a standard module
--
Gary's Student
gsnu200707


"Richo" wrote:

I want to be able to go automate after entering data in the last
cell
in a
row to then go back to the beginning of the next line?








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Auto return

O.K. then.... to auto-return from the last cell in the currently used range:

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = ActiveSheet.UsedRange
nLastColumn = r.Columns.Count + r.Column - 1
If Target.Column < nLastColumn Then
Exit Sub
Else
i = Target.Row + 1
Cells(i, 1).Select
End If
End Sub

--
Gary's Student
gsnu200707


"Roger Govier" wrote:

Hi

Reading the OP's post literally, you are absolutely right.
I had assumed (perhaps wrongly) that he had data stretching across maybe
a dozen or so columns, and wanted to return to the beginning of the next
line after entering the last of "his" row of data.

Shows how we can all interpret a question quite differently <bg

--
Regards

Roger Govier


"Gary''s Student" wrote in
message ...
But Roger, the OP specifically want the auto-return after data was
entered in
the last cell in the row. Usually the last cell in a row is the cell
in
column 256 (column IV) I used Cells.Columns.Count in case the OP was
using
Excel 2007.
--
Gary's Student
gsnu200707


"Roger Govier" wrote:

Hi

Unless the user wants to use the whole row of 256 columns before
jumping
to the next line, wouldn't they need to insert a value equal to their
last column number, rather than using
Cells.Columns.Count

If Target.Column < Cells.Columns.Count Then

Cells.Columns.Count always returns 256 (in XL2003 and lower)

--
Regards

Roger Govier


"Gary''s Student" wrote in
message ...
Put this in worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < Cells.Columns.Count Then
Exit Sub
Else
i = Target.Row + 1
Cells(i, 1).Select
End If
End Sub

REMEMBER worksheet code, not a standard module
--
Gary's Student
gsnu200707


"Richo" wrote:

I want to be able to go automate after entering data in the last
cell
in a
row to then go back to the beginning of the next line?






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Auto return

Richo

Example ranges only..............

Select A1 then Tab across to J1.

Hit ENTER key to move to A2

Alternative method.

Unlock columns A:J then protect the sheet.


Gord Dibben MS Excel MVP

On Mon, 19 Feb 2007 03:43:42 -0800, Richo
wrote:

I want to be able to go automate after entering data in the last cell in a
row to then go back to the beginning of the next line?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I set up an auto return to the next column in excell? radley38 Excel Worksheet Functions 3 November 10th 06 06:35 PM
how can you auto return from columns B1 to A2 arran tw Excel Discussion (Misc queries) 6 July 12th 06 08:01 PM
Auto return month as text date martins Excel Discussion (Misc queries) 1 March 19th 06 02:59 PM
"Auto-return" Jaytee Excel Discussion (Misc queries) 3 September 11th 05 06:00 PM
Auto Return Auto Return Excel Discussion (Misc queries) 1 September 8th 05 08:36 PM


All times are GMT +1. The time now is 05:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"