Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Fil Fil is offline
external usenet poster
 
Posts: 10
Default Mouvement macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 268
Default Mouvement macro

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   Report Post  
Posted to microsoft.public.excel.programming
Fil Fil is offline
external usenet poster
 
Posts: 10
Default Mouvement macro

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   Report Post  
Posted to microsoft.public.excel.programming
Fil Fil is offline
external usenet poster
 
Posts: 10
Default Mouvement macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Mouvement macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Mouvement macro

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   Report Post  
Posted to microsoft.public.excel.programming
Fil Fil is offline
external usenet poster
 
Posts: 10
Default Mouvement macro

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   Report Post  
Posted to microsoft.public.excel.programming
Fil Fil is offline
external usenet poster
 
Posts: 10
Default Mouvement macro

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
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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 06:55 AM.

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

About Us

"It's about Microsoft Excel"