ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Worksheet tax link to user (https://www.excelbanter.com/excel-worksheet-functions/152486-worksheet-tax-link-user.html)

Joyce S

Worksheet tax link to user
 
I am setting up a shared Excel document for a group. Each member of the
group will have an individual worksheet identified on the worksheet tab by
their initials.

How do I set up the workbook so when a user opens it, it will go directly to
that user's assigned worksheet?

JLatham

Worksheet tax link to user
 
First, you should not need a bookmark. Without a bookmark, the document
should simply open at the beginning.

How are you creating your hyperlink? Are you using the worksheet function
=HYPERLINK("link path","Some Friendly Phrase To Display")
or are you choosing text existing in a cell and using Insert | Hyperlink?

Regardless, try using the HYPERLINK() worksheet function just to easily and
quickly test things. You could set one up like:
=HYPERLINK("c:\my documents\glitchedWordFile.doc","Open Glitched Word File")
you can also use a path using network path if you're on a network (works for
everyone better) as:
=HYPERLINK("\\our-server\share\WordDocs\glitchedWordFile.doc","Open Glitched
Word File")

About that error message: are you certain it was an error message? If so,
can you give us more exact wording? There is also possibility that it's just
a security warning message saying "hey, sometimes it's not so safe to just go
merrily clicking random hyperlinks - still wanna roll the dice?" or something
like that <g.

"Joyce S" wrote:

I am setting up a shared Excel document for a group. Each member of the
group will have an individual worksheet identified on the worksheet tab by
their initials.

How do I set up the workbook so when a user opens it, it will go directly to
that user's assigned worksheet?


JLatham

Worksheet tax link to user
 
Try putting this code in the workbook's _Open() event handler. To do so,
open the workbook, then right-click on the Excel icon right next to the word
File in the standard menu and choose [View Code] from the list. copy the
code below and paste it into the module shown to you and close the VB Editor.
Close the workbook and see how it works.

Essentially it's looking for the name of a sheet in the workbook, not
necessarily true initials, but you don't have to tell the users that. It is
not case sensitive, so JLL is same as jll, is same as Jll, etc. If you
mistype it, it gives you infinite chances to get it right, but if you leave
it empty, it will close the workbook.

Private Sub Workbook_Open()
Dim userInitials As String
Do While userInitials = ""
userInitials = InputBox("Enter your user Initials:", "To Continue...", "")
If userInitials = "" Then
ThisWorkbook.Close ' bye bye!
End If
On Error Resume Next
Worksheets(userInitials).Activate
If Err < 0 Then
Err.Clear
MsgBox "Those are not valid initials"
userInitials = ""
On Error GoTo 0
End If
On Error GoTo 0
Loop
End Sub


"Joyce S" wrote:

I am setting up a shared Excel document for a group. Each member of the
group will have an individual worksheet identified on the worksheet tab by
their initials.

How do I set up the workbook so when a user opens it, it will go directly to
that user's assigned worksheet?



All times are GMT +1. The time now is 01:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com