MrExcel Publishing
Your One Stop for Excel Tips & Solutions

macro to go from D1 to A2, D2 to A3, ...and so on

Posted by Sergio on February 11, 2002 8:22 PM

I want to write some data on cells A1, B1, C1 and D1. After hitting Return on D1 I want to go to the second line of information automatically: A2, B2,...D2 and go to A3, ...etc. This has to be done for 500 lines. Anyone has any idea on how to accomplish this? Thanks.

Posted by anno on February 11, 2002 8:48 PM

not a macro, but one way...

not sure if this is what you want, but -
select the cells you want to write in (A1:D500), go to format menu>cells>protection tab and uncheck the 'locked' checkbox. then go to tools menu>protection>protect sheet and follow the instructions for password entry.
the only thing is you'll need to use the tab key instead of the return/enter key to make this go from A1-D1 then to A2, B2 etc.

Posted by Derek on February 11, 2002 8:49 PM

Use this worksheet macro. Make sure your options are set to move right after you press enter.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 5 Then ActiveCell.Offset(1, -4).Select
End Sub

Have fun

Posted by Sergio on February 12, 2002 5:31 AM

Re: not a macro, but one way...

Thanks, this works fine.

Posted by Sergio on February 12, 2002 5:33 AM

Derek, I'm not experienced with excel but I've done some simple macros. How do I get this one to run or is it supposed to be active all the time. Please help.

Posted by Sergio on February 12, 2002 6:03 AM

Re: Thanks, I made it work