Including images in a tab order sequence.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a protected worksheet with only four cells and an image that the user
can select with their mouse.
I want keyboard users to be able to select these same items without a mouse.
They can move between the four cells easily enough by pressing the tab key,
but how do I get the image included in the tab sequence?
Thank you.
 
Hi,

Try to use :

While your sheet protected run it:
Sub EnableTab()
Application.OnKey "{tab}", "EnabTAB"
End Sub

Sub EnabTAB()
If ActiveCell.Column <> 256 Then ActiveCell.Offset(0, 1).Select
End Sub
 
If your sheet protection includes 'Locked' objects you won't be able to
select them with any method. Otherwise you could select all objects from F5
(or ctrl-G) > Special > Objects then tab between them, then Esc to
re-activate the last cell selection.

Regards,
Peter T
 
Hi,

Thanks for your reply.
What I would like to do is 'attach' the image somehow to a cell which I
could then unprotect and the tab sequence would presumably include this cell
in its sequence when the user pressed the tab key.
Is it possible to 'attach' the image to the cell in this way, and if so how
do I do it?

Thank you.
 
You cannot attach a graphic to a cell, but..
Assuming that after cell D7 you wish to select a grphic called "Picture1" :

Const CellJumpToGraphic As String = "$D$7"
Dim LastCell As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not LastCell Is Nothing Then
If LastCell.Address = CellJumpToGraphic Then
Shapes("Picture1").Select
End If
End If
Set LastCell = Target
End Sub

But you need to make sure the WS is protected without the Objects option
checked and .EnableSelection is set to xlUnlocked cells.

NickHK
 
That worked a treat.
Thank you for your help.

NickHK said:
You cannot attach a graphic to a cell, but..
Assuming that after cell D7 you wish to select a grphic called "Picture1" :

Const CellJumpToGraphic As String = "$D$7"
Dim LastCell As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not LastCell Is Nothing Then
If LastCell.Address = CellJumpToGraphic Then
Shapes("Picture1").Select
End If
End If
Set LastCell = Target
End Sub

But you need to make sure the WS is protected without the Objects option
checked and .EnableSelection is set to xlUnlocked cells.

NickHK
 
Back
Top