Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Automatically Move to a cell

Is it possible to program so that when a users exits a cell he/she is forced
to another cell, ie when leaving d3 the cursor will got to d33

I know about cell protection etc but that will not do what I would like

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Automatically Move to a cell

You can do this with a worksheet_change macro in the sheet code.
right click sheet tabview codeleft window select worksheetright select
worksheet_change

more info needed but this is the basic idea

target.offset(30).select


--
Don Guillett
SalesAid Software

"Nigel" wrote in message
...
Is it possible to program so that when a users exits a cell he/she is
forced
to another cell, ie when leaving d3 the cursor will got to d33

I know about cell protection etc but that will not do what I would like

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Automatically Move to a cell

not sure what more info is needed, user exits cell d3 I would like cursor to
go to d33

then they can select cell d4 make an entry and cursor will then go to c3

then they select d5 make an entry and on exiting it will go to gXX and so on

Cells are paired for example A10 is related to U10m B10 is related to W19
AND SO ON

"Don Guillett" wrote:

You can do this with a worksheet_change macro in the sheet code.
right click sheet tabview codeleft window select worksheetright select
worksheet_change

more info needed but this is the basic idea

target.offset(30).select


--
Don Guillett
SalesAid Software

"Nigel" wrote in message
...
Is it possible to program so that when a users exits a cell he/she is
forced
to another cell, ie when leaving d3 the cursor will got to d33

I know about cell protection etc but that will not do what I would like

Thanks




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Automatically Move to a cell


Don,

I am so sorry I don't mean to shout, didn't look at the keyboard and see
caps lock on

Once again sorry


"Don Guillett" wrote:

AND SO ON


no need to SHOUT! I'm still confused since mind reading is not one of my
talents but, in the absence of a better explanation from you, in the
worksheet_CHANGE event.

=if target.address="$d$3" then range("c3").select
=if target.address="$d$5" then range("gxxx").select
and so on

I'm sure it could be simplified.

--
Don Guillett
SalesAid Software

"Nigel" wrote in message
...
not sure what more info is needed, user exits cell d3 I would like cursor
to
go to d33

then they can select cell d4 make an entry and cursor will then go to c3

then they select d5 make an entry and on exiting it will go to gXX and so
on

Cells are paired for example A10 is related to U10m B10 is related to W19
AND SO ON

"Don Guillett" wrote:

You can do this with a worksheet_change macro in the sheet code.
right click sheet tabview codeleft window select worksheetright select
worksheet_change

more info needed but this is the basic idea

target.offset(30).select


--
Don Guillett
SalesAid Software

"Nigel" wrote in message
...
Is it possible to program so that when a users exits a cell he/she is
forced
to another cell, ie when leaving d3 the cursor will got to d33

I know about cell protection etc but that will not do what I would like

Thanks








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Automatically Move to a cell

Nigel

Maybe something similar to this?

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$C$2"
Range("C5").Select
Case "$C$5"
Range("E2").Select
Case "$E$2"
Range("E5").Select
End Select
End Sub

If there is a pattern, you might be able to use Offset(r,c) instead of
hard-coded references.


Gord Dibben MS Excel MVP


On Thu, 19 Oct 2006 12:26:02 -0700, Nigel wrote:


Don,

I am so sorry I don't mean to shout, didn't look at the keyboard and see
caps lock on

Once again sorry


"Don Guillett" wrote:

AND SO ON


no need to SHOUT! I'm still confused since mind reading is not one of my
talents but, in the absence of a better explanation from you, in the
worksheet_CHANGE event.

=if target.address="$d$3" then range("c3").select
=if target.address="$d$5" then range("gxxx").select
and so on

I'm sure it could be simplified.

--
Don Guillett
SalesAid Software

"Nigel" wrote in message
...
not sure what more info is needed, user exits cell d3 I would like cursor
to
go to d33

then they can select cell d4 make an entry and cursor will then go to c3

then they select d5 make an entry and on exiting it will go to gXX and so
on

Cells are paired for example A10 is related to U10m B10 is related to W19
AND SO ON

"Don Guillett" wrote:

You can do this with a worksheet_change macro in the sheet code.
right click sheet tabview codeleft window select worksheetright select
worksheet_change

more info needed but this is the basic idea

target.offset(30).select


--
Don Guillett
SalesAid Software

"Nigel" wrote in message
...
Is it possible to program so that when a users exits a cell he/she is
forced
to another cell, ie when leaving d3 the cursor will got to d33

I know about cell protection etc but that will not do what I would like

Thanks







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Automatically Move to a cell

Again so sorry I used your code and it works great, i added another sub and
here is that

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Application.ScreenUpdating = False
If Not rngPrev Is Nothing Then rngPrev.Interior.ColorIndex = idxPrev
Set rngPrev = Target
idxPrev = rngPrev.Interior.ColorIndex
rngPrev.Interior.ColorIndex = 6

End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
'player 1
If Target.Address = "$A$10" Then Range("U10").Select
If Target.Address = "$C$10" Then Range("w19").Select
If Target.Address = "$E$10" Then Range("Y28").Select
If Target.Address = "$G$10" Then Range("AA37").Select
If Target.Address = "$I$10" Then Range("ac46").Select
end sub
the problem is this

I enter a value in A10 and hit tab the cursor moves to c10 and then onto u10
changes the color of u10 correctly but jumps back to c10. do you have any
idea why it may be doing this
"Don Guillett" wrote:

AND SO ON


no need to SHOUT! I'm still confused since mind reading is not one of my
talents but, in the absence of a better explanation from you, in the
worksheet_CHANGE event.

=if target.address="$d$3" then range("c3").select
=if target.address="$d$5" then range("gxxx").select
and so on

I'm sure it could be simplified.

--
Don Guillett
SalesAid Software

"Nigel" wrote in message
...
not sure what more info is needed, user exits cell d3 I would like cursor
to
go to d33

then they can select cell d4 make an entry and cursor will then go to c3

then they select d5 make an entry and on exiting it will go to gXX and so
on

Cells are paired for example A10 is related to U10m B10 is related to W19
AND SO ON

"Don Guillett" wrote:

You can do this with a worksheet_change macro in the sheet code.
right click sheet tabview codeleft window select worksheetright select
worksheet_change

more info needed but this is the basic idea

target.offset(30).select


--
Don Guillett
SalesAid Software

"Nigel" wrote in message
...
Is it possible to program so that when a users exits a cell he/she is
forced
to another cell, ie when leaving d3 the cursor will got to d33

I know about cell protection etc but that will not do what I would like

Thanks






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Automatically Move to a cell

Nigel,

I'm wasn't clear from your origianl post as to whether you want to move the
selected cell after entering data into a specific cell OR after a specific
cell was selected and not data/format change to place.

So at the moment the reason it jumps back to C10 after the color changes in
U10 is because that is a change event (ie not just data).

So on what basis do you want the changes to take place?

Best regards

John

PS Did you read my reply to your original post :
http://groups.google.co.uk/group/mic...567267c13f6263

"Nigel" wrote in message
...
Again so sorry I used your code and it works great, i added another sub
and
here is that

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Application.ScreenUpdating = False
If Not rngPrev Is Nothing Then rngPrev.Interior.ColorIndex = idxPrev
Set rngPrev = Target
idxPrev = rngPrev.Interior.ColorIndex
rngPrev.Interior.ColorIndex = 6

End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
'player 1
If Target.Address = "$A$10" Then Range("U10").Select
If Target.Address = "$C$10" Then Range("w19").Select
If Target.Address = "$E$10" Then Range("Y28").Select
If Target.Address = "$G$10" Then Range("AA37").Select
If Target.Address = "$I$10" Then Range("ac46").Select
end sub
the problem is this

I enter a value in A10 and hit tab the cursor moves to c10 and then onto
u10
changes the color of u10 correctly but jumps back to c10. do you have any
idea why it may be doing this
"Don Guillett" wrote:

AND SO ON


no need to SHOUT! I'm still confused since mind reading is not one of my
talents but, in the absence of a better explanation from you, in the
worksheet_CHANGE event.

=if target.address="$d$3" then range("c3").select
=if target.address="$d$5" then range("gxxx").select
and so on

I'm sure it could be simplified.

--
Don Guillett
SalesAid Software

"Nigel" wrote in message
...
not sure what more info is needed, user exits cell d3 I would like
cursor
to
go to d33

then they can select cell d4 make an entry and cursor will then go to
c3

then they select d5 make an entry and on exiting it will go to gXX and
so
on

Cells are paired for example A10 is related to U10m B10 is related to
W19
AND SO ON

"Don Guillett" wrote:

You can do this with a worksheet_change macro in the sheet code.
right click sheet tabview codeleft window select worksheetright
select
worksheet_change

more info needed but this is the basic idea

target.offset(30).select


--
Don Guillett
SalesAid Software

"Nigel" wrote in message
...
Is it possible to program so that when a users exits a cell he/she
is
forced
to another cell, ie when leaving d3 the cursor will got to d33

I know about cell protection etc but that will not do what I would
like

Thanks








  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Automatically Move to a cell

Hi Nigel,

You could try the Selection Change event. Put this code behine the
worksheet object you're after:

Private m_bPostD3SelectCell As Boolean

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If m_bPostD3SelectCell = True Then
Call SelectCell
End If
If Target.Address = "$D$3" Then
m_bPostD3SelectCell = True
End If
End Sub

Private Sub SelectCell()
Range("D33").Select
m_bPostD3SelectCell = False
End Sub

Hope that helps

Best regards

John


"Nigel" wrote in message
...
Is it possible to program so that when a users exits a cell he/she is
forced
to another cell, ie when leaving d3 the cursor will got to d33

I know about cell protection etc but that will not do what I would like

Thanks



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
Automatically move to next cell... Paul Ez Excel Worksheet Functions 1 January 23rd 08 09:56 AM
Automatically move cursor when cell value changes scotty New Users to Excel 3 January 23rd 07 12:03 AM
Automatically move cursor when cell value changes Gary''''s Student New Users to Excel 0 January 19th 07 08:20 PM
Automatically move cursor when cell value changes scotty New Users to Excel 0 January 19th 07 08:15 PM
Move automatically to a cell Box666 Excel Discussion (Misc queries) 2 October 15th 05 10:34 AM


All times are GMT +1. The time now is 04:33 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"