LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default move cursor

Thanks Tom,

That was exactly what i was looking for.
You're the best.

Greets,
Peter
"Tom Ogilvy" schreef in bericht
...
Just use the selectionchange event to record (update a static variable)
the
last activecell (it already tells you the cell selected). Test if the
last
active cell was one of the ones you are interested in, and if so, then
change the selection to the next cell you want selected. Make sure you
disable events so you don't go into an endless loop.

so as an example, right click on the sheet tab and select view code. Put
in
code like this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static oldCell As Range
If Not oldCell Is Nothing Then
Debug.Print oldCell.Address
Select Case oldCell.Address(0, 0)
'A1 = G5 = E3 = K10 = F2
Case "A1": sStr = "G5"
Case "G5": sStr = "E3"
Case "E3": sStr = "K10"
Case "K10": sStr = "F2"
Case "F2": sStr = "A1"
Case Else: sStr = ""
End Select
If sStr < "" Then
Application.EnableEvents = False
Range(sStr).Select
Application.EnableEvents = True
End If
End If
Set oldCell = ActiveCell

End Sub

--
Regards,
Tom Ogilvy



"Peter" wrote in message
...
Hi again Tom,

That was something i knew, but it is not what i meant.
I'm going to try to give you an example of what i want.

in a vba code:
A1 = G5 = E3 = K10 = F2
when A1 is selected and enter is hit move to cell G5
when E3 is selected and enter is hit move to cell K10
when................and so on

The starting cell is a single selected cell, the end cel is the next cell
that has been written in the code.

I don't want all the cells selected at the same time, i'm just looking
for

a
taborder to move from one cell to another.

Regards,
Peter


"Tom Ogilvy" schreef in bericht
...
Just to clarify.
Use the mouse and the control key to select the cells in the order you
want
to nagivate through them (so that all the cells of interest are

selected).
then leave them selected.

Now use the enter/return key to travel through them.

--
Regards,
Tom Ogilvy


"Peter" wrote in message
...
No, the activecell is specified.
It's like the textbox- taborder in a userform, you know what i mean?
"Tom Ogilvy" schreef in bericht
...
No matter where the activecell is, if the user hits enter, you want

to
go
to
G4?

--
Regards,
Tom Ogilvy

"Peter" wrote in message
...
Hi,

Is it possible that, when you hit the enter button, the cursor
moves
to
a
cell specified by me?
For instance:
A1 =="enter" ==G4














 
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
move cursor on one sheet moves cursor on all sheets tdworden Excel Discussion (Misc queries) 2 July 22nd 07 10:50 PM
Move cursor to next row Hank Excel Discussion (Misc queries) 1 August 4th 06 09:56 PM
Move Cursor to A1 Silver Excel Discussion (Misc queries) 3 January 7th 05 02:49 PM
macro to move cursor Bob S[_2_] Excel Programming 4 January 15th 04 03:36 PM
HOW TO MOVE CURSOR Fernando Duran Excel Programming 2 September 17th 03 06:55 PM


All times are GMT +1. The time now is 10:23 PM.

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"