LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Problems with macro, setting "tab order" of unprotected cells

Alright, maybe I can help, I am doing the same thing, the problem with
this code I have is that it cycles through all the referenced cells
before it repeats. THis has two drawbacks, First you have to tell it
exactly every cell to go to and secondly, if you make a mistake, you
have to tab through every cell before you can correct. Trying to find
a fix for this currently. I got the code from here,
http://www.ozgrid.com/forum/showthread.php?t=82272

This is what the code I use looks like, and it does work, with the
limitations listed above.

Dim aTabOrd As Variant
Dim iTab As Long
Dim nTab As Long

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim iNew As Long

If IsEmpty(aTabOrd) Then
aTabOrd = Array("F6", "F7", "U7", "F8", "F9", "F10", "F11",
"F12", "A14", "E14", "J14", _
"O14", "A16", "D16", "A18", "E18", "A21", "L21", "A24", "F24",
"J24", "N24", "C25", "H25", _
"U25", "I26", "A29", "C29", "A31", "H31", "M31", "B33", "H33",
"Z33", "AG33", "E35", "H35", _
"K35", "N35", "Z35", "AG35", "C36", "F36", "Z36", "AG36", "A38",
"G38", "J38", "Z38", "AG38", _
"C39", "AG39", "H40", "AG40", "F41", "O41", "AG41", "A43", "G43",
"AG43", "B45", "E45", "I45", _
"AG45", "B47", "E47", "H47", "K47", "AG47", "E50", "I50", "U50",
"AG50", "E51", "AG51", "G53", _
"I53", "N53", "B55", "E55", "H55", "N55", "U55", "Z55", "G57",
"I57", "N57", "U57", "Z57", "AE57", _
"D59", "U59", "E62", "H62", "N62", "E63", "I63", "M63", "E64",
"I64", "M64", "Q64", "U64", _
"E65", "I65", "E67", "I67", "G69", "Z69", "AD69", "AI69", "Z71",
"AD71", "AI71", "Z72", "AD72", _
"AI72", "A73", "R73", "Z73", "AD73", "AI73", "A74", "R74", "Z74",
"AD74", "AI74", "Z75", "AD75", _
"AI75", "G78", "AC2")

nTab = UBound(aTabOrd) + 1
iTab = 0
Else
On Error Resume Next
iNew = WorksheetFunction.Match(Target.Address(False, False),
aTabOrd, 0) - 1
If Err Then
iTab = (iTab + 1) Mod nTab
Else
iTab = iNew
End If
On Error GoTo 0
End If

Application.EnableEvents = False
Range(aTabOrd(iTab)).Select
Application.EnableEvents = True

End Sub

 
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
Setting macro security level to "low" permanently? Bill Seaton Excel Discussion (Misc queries) 3 June 5th 09 10:47 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" ldiaz Excel Discussion (Misc queries) 2 March 16th 08 09:23 PM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM
"Save as" macro problems Angelique_Peach Excel Discussion (Misc queries) 0 April 25th 06 09:38 PM


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