• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

"Click" hyperlink without mouse?

eibi

Active Member
I'm setting up a workbook with several forms for coworkers to fill out. I want the forms to be set up so that my coworkers can tab between cells and complete the whole book with minimal 'mousing'.

On a "normal" form (such as a web-based form), a user can simply Tab through the blanks to the "Submit" button or "Next" link and proceed to the next page by pressing Space or Enter.

In my excel form, though, when the form is complete and the user is ready to proceed to the next step using the "Return to Home" hyperlink, pressing Tab doesn't work.

Instead: Mouse.Required

Is it possible to set up a mechanism so that a user can follow this link with a keyboard stroke?

See attached. Note that you'll have to "enable editing" when you download in order to see the functionality I'm talking about...
 

Attachments

  • Hyperlink.xlsx
    15.3 KB · Views: 4
Hooray -- I'm a VBA newbie, but I solved it.

Luke, thanks for the link...it got me headed in the right direction.

Code:
Private Sub Worksheet_Activate()

    Application.OnKey "~", "FollowHyperlink"

End Sub

---------------------------------------------
Private Sub Worksheet_Deactivate()

    Application.OnKey "~"

End Sub

---------------------------------------------
Sub FollowHyperlink()
'
' Follow a hyperlink

If ActiveCell.Hyperlinks.Count > 0 Then

    ActiveCell.Hyperlinks(1).Follow (True)

Else

    ActiveCell.Next.Select

End If
                                             
End Sub
 
Last edited:
nice trick eibi,

I may add this to my personal workbook, and change the key mapping to Ctrl+~, if for no other reason than I hate when I accidentally hit Ctrl+~ and end up in formula view. :p
 
Back
Top