Moving Through The Cells

clumein2

New Member
Joined
Sep 1, 2006
Messages
32
Let's say I had a sheet of 10 columns and 10 rows. I begin entering data at A1 and tab through all 10 columns and don't want the next tab to put the cursor at column 11, I want it to go to the next line, A2, how would I do that?

Thanks

Cliff
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Thanks for the offering venkat, but I know how to get 'home' and 'down'. I just need to tab on over to the line.
 
Upvote 0
Copy the below code.

Press Alt F11
Click on the 'ThisWorkbook' object of your spreadhseet.
Paste in the code
Save your spreadsheet

Activate cell A1
tab to the right, and
when you get to column K,
the cursor will drop down one row and go to column A.


'----- code starts below this line


Public sColumn As String


Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
' Code modified 09/03/2006 by Stanley D. Grom, Jr.
' Windows XP Professional SP2
' Excel 2003 SP2
'
sColumn = ActiveCell.Column
If sColumn = 11 Then
ActiveCell.Offset(1, -10).Range("A1").Select
End If
End Sub


'----- code ends above this line


Have a great day,
Stan
 
Upvote 0
Cliff

Try unlocking all the cells in the range A1:J10, then protecting the sheet. Tabbing will move across the row, then to the next line as applicable.

HTH

Tony
 
Upvote 0
Stanley, thank you works great. I figured out how to adjust it for the actual columns but I'd like it to jump back to column 6 - not 1. What would I change it the formula for that to happen.

thanks much

sColumn = ActiveCell.Column
If sColumn = 15 Then
ActiveCell.Offset(1, -14).Range("A1").Select
End If
End Sub
 
Upvote 0
ok Stanley one more ok? I see how that works..... great, but........

I have 2 worksheets (maybe I should've told you that, sorry) So this code is working the same on bothe sheets.. but the 2nd sheet is set up different so etc etc.

I tried after Alt11 to apply it to just to the indivedual sheets in the object tree but it applies it to both.... how do I just select one sheet at a time so I could change the formula for each one?

thanks again......
 
Upvote 0

Forum statistics

Threads
1,225,847
Messages
6,187,364
Members
453,420
Latest member
ESCH1021

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top