I have a table divided into protected and unprotected sections. In the
unprotected sections, when the user tabs, a new line is created (as though
it were the end of the table). I want to disable the "next cell" function in
these cases, or otherwise prevent the creation of a new row, or force
navigation to the next form field/section. Any suggestions?
Thanks.
Shauna Kelly - 16 Feb 2008 10:04 GMT
Hi
See
Intercepting events like Save and Print
http://www.word.mvps.org/FAQs/MacrosVBA/InterceptSavePrint.htm
You can intercept the NextCell command. You'll have to write code that
determines when the user should be able to tab to the next cell and when
not.
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
>I have a table divided into protected and unprotected sections. In the
> unprotected sections, when the user tabs, a new line is created (as
[quoted text clipped - 5 lines]
>
> Thanks.
Helmut Weber - 16 Feb 2008 11:37 GMT
Hi Neophyte,
something along these lines:
Sub NextCell()
Dim rTbl As Range
Set rTbl = Selection.Tables(1).Range
If Selection.Cells(1).Range.IsEqual( _
rTbl.Cells(rTbl.Cells.Count).Range) Then
MsgBox "lastcell"
Else
Selection.Cells(1).Next.Select
Selection.Collapse
End If
End Sub
HTH
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Vista Small Business, Office XP