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

I found this macro online for controlling tab order among unlocked
cells in a protected worksheet, and modified it to list the cells in
the tab order I need them, per instructions for the macro:

Private Sub Worksheet_Change(ByVal Target As Range)
'Anne Troy 's taborder event code
Dim aTabOrd As Variant
Dim i As Long

'Set the tab order of input cells
aTabOrd = Array("B1", "B3", "B4", "B5", "F1", "F3", "B10", "B12",
"E14", "B16", "F38", "A43", "A44", "A45", "A46", "A47", "A48", "A49",
"A50", "A51", "A52", "A53", "A54", "A55", "A56", "A57", "A58", "A59",
"A60", "F76", "F78")
'Loop through the array of cell address
For i = LBound(aTabOrd) To UBound(aTabOrd)
'If the cell that's changed is in the array
If aTabOrd(i) = Target.Address(0, 0) Then
'If the cell that's changed is the last in the array
If i = UBound(aTabOrd) Then
'Select first cell in the array
Me.Range(aTabOrd(LBound(aTabOrd))).Select
Else
'Select next cell in the array
Me.Range(aTabOrd(i + 1)).Select
End If
End If
Next i

End Sub
----
I have two problems.

The first is that this doesn't work reliably. Sometimes after I
unprotect and edit the sheet, protect it again and test it, it will
skip some cells entirely... and the cells it skips can be different
from one test to the next (but always skips the same set of cells
until after the next edit).

The other problem is that I need the macro to work whether or not a
change has been made in any of the cells, which could be different
each time the worksheet is used. This version doesn't do that, and I
am not trained in VBA. I used to be a programmer and can tell what the
macro is doing as I read through it, but have no idea what code I
would need to get it to do what I want.
 
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 09:35 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"