//some 3rd party need geo

Controling 'Enter' Key in Excel

  Zak 20:06 05 Mar 04
Locked

I know that in Tools,Options, Edit Tab you can remove the check so that the cursor does not move on hitting the 'Enter' key.

However, this affects all spreadsheets and if the workbook is opened on another machine this control is lost.

Is there a Macro that would give this control solely to the required workbook?

I need to issue this workbook to a number of users most who only know the bare minimum. , therefore them having to change settings is not an option.

Any suggestions & solutions will be most welcome.

Thanks

  MarkusAsparagus 20:32 05 Mar 04

You need to create a macro with the line

Application.MoveAfterReturn = False

Ideally make the macro such that it runs automatically when the workbook is opened

  MarkusAsparagus 20:43 05 Mar 04

An actual macro to do this would be:

Sub auto_open()

Application.MoveAfterReturn = False

End Sub

  MarkusAsparagus 20:44 05 Mar 04

Sub auto_open()

Application.MoveAfterReturn = False

End Sub



Sorry - missed the last line off the first post

  MarkusAsparagus 20:44 05 Mar 04

Sub auto_open()


Application.MoveAfterReturn = False


End Sub

  MarkusAsparagus 20:45 05 Mar 04

Finally - a three line macro displaying correctly!

  Zak 21:11 05 Mar 04

Thanks MarkusAsparagus, but I have tried it and the macro does not work for me.

  VoG II 21:24 05 Mar 04

Right click sheet tab, select View Code

Paste in the following 3 lines

Private Sub worksheet_change(ByVal Target As Excel.Range)

Target.Select

End Sub

A bit messy but it works.

  Zak 21:47 05 Mar 04

Thanks VoG, but can't make this work either.

Following your instructions

Private Sub worksheet_change(ByVal Target As Excel.Range)

End Sub

is already there.

I tried pasting in full your suggestion below, I also inserted

Target.Select

and also tried pasting your code in "this workbook"

I failed miserably, obviously doing it wrong. I am on Excel 97.

  VoG II 22:00 05 Mar 04

Right click sheet tab, select View Code

Delete everything that is there by default. Then paste in

Private Sub worksheet_change(ByVal Target As Excel.Range)

Target.Select

End Sub

  VoG II 22:05 05 Mar 04

P.S. I think that what is there by default in 97 is


Private Sub worksheet_SelectionChange(ByVal Target As Excel.Range)

Which is not the same.

This thread is now locked and can not be replied to.

What is Google Allo? What is Google Duo? Google Allo UK release date rumours and features: Google…

1995-2015: How technology has changed the world in 20 years

These clever designs help visualise a complex intelligence tool

iOS 10 troubleshooting tips: Simple fixes for the most common iOS 10 problems, from network…