Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Negotiating Cells in Specific Order

I have an array of unlocked cells that constitue a range:
e.g. d7 h7 d8 h8 d9 h9 h10 c12 f12
I would like the TAB and ENT keys to always negotiate the range in an
explicit way.
e.g. in the order: d7 d8 d9 c12 f12 h7 h8 h9 h10

Is there a relatively elegant way of doing this?
I'm building up a monster of a module to take care of this
(involving Worksheet_SelectionChange procedure
Case statements and
keeping track of the "previous" selection.)
My intuition tells me I'm missing something.... Any help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Negotiating Cells in Specific Order


Hello PaulD,

If by elegant you mean something in Excel that allows you to control
the tab order of the cells, then the answer is no. The Enter key can be
set to go up, down left or right when pressed. The Tab key can only go
left or right. If a worksheet were like a UserForm where the Tab Order
could be specified life would be good. As far I as know you are taking
the only approach possible.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=555835

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Negotiating Cells in Specific Order

Paul,
This seems to work.
<Module Code
Public TabCells As Variant
Public CurrentCell As Long
Public Const CellOrder As String = "A1,B2,C1,B1,A2,C2"
</Module Code
<ThisWorkbook code
Private Sub Workbook_Open()
TabCells = Split(CellOrder, ",")
CurrentCell = LBound(TabCells)
End Sub
</ThisWorkbook code
<Worksheet code
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If CurrentCell = UBound(TabCells) Then
CurrentCell = LBound(TabCells)
Else
CurrentCell = CurrentCell + 1
End If
Range(TabCells(CurrentCell)).Select
Application.EnableEvents = True
End Sub
</Worksheet code

NickHK

"PaulD" wrote in message
...
I have an array of unlocked cells that constitue a range:
e.g. d7 h7 d8 h8 d9 h9 h10 c12 f12
I would like the TAB and ENT keys to always negotiate the range in an
explicit way.
e.g. in the order: d7 d8 d9 c12 f12 h7 h8 h9 h10

Is there a relatively elegant way of doing this?
I'm building up a monster of a module to take care of this
(involving Worksheet_SelectionChange procedure
Case statements and
keeping track of the "previous" selection.)
My intuition tells me I'm missing something.... Any help?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Negotiating Cells in Specific Order

Thanks Nick
I thought I'd tried something like that, but on review I see I made some
bone-headed mistakes. Also I'm waiting for updated references from Amazon
(currently refering to Webb's '96 book). I'm gonna; i. use ur example, and
ii. fool w/ it and
apply to muli-pages in a Wb.
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
copy cells down a column (in order) to across a row (same order?? Tampa9 Excel Discussion (Misc queries) 1 December 4th 08 04:23 PM
Have 2 Macros run in a specific order...Can This Be Done Dtown Dawg Excel Programming 2 June 7th 06 08:07 PM
print specific worksheets in specific order. jarvo Excel Programming 1 April 11th 06 11:05 AM
"tab" thru cells in a specific order SteelDetailer[_2_] Excel Programming 2 November 5th 05 03:51 PM
"tab" thru cells in a specific order SteelDetailer[_2_] Excel Programming 9 November 3rd 05 06:27 PM


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