Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I'm developping an excel workbook where users enter some data, than
activate a macro that treat that data in some way, pretty standard stuff. The problem is, the users have to enter a lot of data, so I need a macro that they can activate, that will make it so that when they press enter, it automatically goes to the next cell. It would pretty much move one cell left every time they press enter until they get to the end of the line where it will go to the first cell of the next line. Is that possible? If so, how? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And once it reaches the first cell of the next row, how does it move from
there? "Fil" wrote: Hi, I'm developping an excel workbook where users enter some data, than activate a macro that treat that data in some way, pretty standard stuff. The problem is, the users have to enter a lot of data, so I need a macro that they can activate, that will make it so that when they press enter, it automatically goes to the next cell. It would pretty much move one cell left every time they press enter until they get to the end of the line where it will go to the first cell of the next line. Is that possible? If so, how? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It starts over again.
So for exemple, lets say the valid columns are the ones between 1 and 5 and the current cell selected is B3. He presses enter once, it goes to B4. He presses enter again, B5, again, C1, C2, C3, C4, C5, D1, D2... etc "kassie" wrote: And once it reaches the first cell of the next row, how does it move from there? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Wow... I don't know what I was thinking, I got the letters and numbers
inverted. What I ment in my previous post's exemple was : "So for exemple, lets say the valid columns are the ones between A and E and the current cell selected is C3. He presses enter once, it goes to D3. He presses enter again, E3, again, A4, B4, C4, D4, E4, A5, B5... etc" Sorry for the confusion. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I dont know if im reading this right but....
Can you just unlock the cells you want entry into (columns a to e would do) and protect the worksheet stating select unlocked cells only then: Application.MoveAfterReturnDirection = xlToRight (or do this manually, tools, options, edit - enter direction setting) This should surely sort it? Let us know because im not sure if ive read it right. Duncan Fil wrote: Wow... I don't know what I was thinking, I got the letters and numbers inverted. What I ment in my previous post's exemple was : "So for exemple, lets say the valid columns are the ones between A and E and the current cell selected is C3. He presses enter once, it goes to D3. He presses enter again, E3, again, A4, B4, C4, D4, E4, A5, B5... etc" Sorry for the confusion. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Behind a button this would look like:
Range("A:E").Locked = False ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True ActiveSheet.EnableSelection = xlUnlockedCells Application.MoveAfterReturnDirection = xlToRight But bear in mind: You will need to unprotect via code and wont be able to by the worksheet, so another button that had "activesheet.unprotect" would be advised before you tried this! Duncan Duncan wrote: I dont know if im reading this right but.... Can you just unlock the cells you want entry into (columns a to e would do) and protect the worksheet stating select unlocked cells only then: Application.MoveAfterReturnDirection = xlToRight (or do this manually, tools, options, edit - enter direction setting) This should surely sort it? Let us know because im not sure if ive read it right. Duncan Fil wrote: Wow... I don't know what I was thinking, I got the letters and numbers inverted. What I ment in my previous post's exemple was : "So for exemple, lets say the valid columns are the ones between A and E and the current cell selected is C3. He presses enter once, it goes to D3. He presses enter again, E3, again, A4, B4, C4, D4, E4, A5, B5... etc" Sorry for the confusion. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well... I didn't think of it that way, but it works.
Problem is, this was ment to speed up the entry, not prevent them from changing other stuff, I'll have to check with the users to see if locking the worksheet during entry is a problem. Thank you for your help. "Duncan" wrote: I dont know if im reading this right but.... Can you just unlock the cells you want entry into (columns a to e would do) and protect the worksheet stating select unlocked cells only then: Application.MoveAfterReturnDirection = xlToRight (or do this manually, tools, options, edit - enter direction setting) This should surely sort it? Let us know because im not sure if ive read it right. Duncan |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I talked to fast, it doesn't work correctly. For some reason, when I get to
the end of a certain line (multiple tests gave me a bunch of different results), it goes back to the first line. So it goes A1, B1, C1, D1, E1, A2, B2, C2, D2, E2, A1... I am able to select A3 for exemple and it will go : A3, B3, C3, D3, E3, A1, B1, C1, D1, E1, A2, B2, C2, D2, E2, A1... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |