Computing.Net > Forums > Office Software > Link tab name to cell

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Link tab name to cell

Reply to Message Icon

Name: omz45
Date: October 28, 2009 at 08:02:43 Pacific
OS: Windows XP
Subcategory: Microsoft Office
Comment:

II'm quite new on here, actually completely fresh so please excuse me if this has been covered already.

I'm trying to get 58 tabs, all of which contain the same report, linked to a list on a contents sheet at the front.

There has already been a posting before but i cant reply to it as its too old.

I followed these instrustions:

Sub Hyperlinker()
For Each cName In Sheets(1).Range("A1:A4")
ActiveSheet.Hyperlinks.Add Anchor:=cName, Address:="", SubAddress:= _
cName & "!A1", TextToDisplay:=cName.Value
Next
End Sub


But what i've found is that it doesn't hyperlink to the sheet because it is shown as 'The Sheet' instead of The Sheet.

I'm hoping someone can help because ive gone through the 58 sheets twice now, once to link the sheet to the title and another to get the same name on the tab.

Its too fustrating!



Sponsored Link
Ads by Google

Response Number 1
Name: DerbyDad03
Date: October 28, 2009 at 08:25:35 Pacific
Reply:

I'm not sure what you are doing wrong, but I ...

1- Copied the code from your post into a new workbook
2 - Added a Sheet4
3 - Entered Sheet1, Sheet2, Sheet3 & Sheet4 into Sheet1!A1:A4

When I ran the code it created links to all 4 sheets.

Is that the process you are following?

(I posted that code a while back, so I was pretty sure it was going to work.)


0

Response Number 2
Name: Humar
Date: October 28, 2009 at 09:10:33 Pacific
Reply:

Hi,

Try this.

It gets all the worksheet names and puts the names in the Active worksheet starting
at Cell A1 and adds the hyperlinks.

No need to enter the 58 names.

Sub SheetsHyper()
Dim objSht As Worksheet
Dim strSht As String
Dim n As Integer
n = 0

For Each objSht In ActiveWorkbook.Worksheets
    strSht = objSht.Name
    ActiveSheet.Range("A1").Offset(n, 0).Value = strSht
    ActiveSheet.Hyperlinks.Add Anchor:=ActiveSheet.Range("A1").Offset(n, 0), Address:="", SubAddress:= _
    strSht & "!A1", TextToDisplay:=strSht
    n = n + 1
Next
End Sub

Regards


0

Response Number 3
Name: omz45
Date: October 29, 2009 at 07:43:40 Pacific
Reply:

Hi guys,

Thanks for the quick response.
I tried tre above code and it brought up the list but provided the same hyperlinking error.
I have subsequently editted all 58 links so that they go to the right place.

When using your code Humar, as with DerbyDad03's previously posted code, it linked the cells but when you hover over the cell the tab name does not start with and end with '.
When I edit hyperlink all the tab names are i.e. 'The Queenswood'. This may have been because I copied 1 tab to create the other 57 as the first on was without the '.

Either way I added a ' to the start and end of every name in the list and it worked


The code above was very helpful, thank you!


0

Response Number 4
Name: Humar
Date: October 29, 2009 at 08:13:50 Pacific
Reply:

Hi,

Glad we were able to help.

Still puzzled by the ' issue.

I thought that Tab names could not start with a '
If your tab names start with a ' then that may explain the error you have been seeing.

Anyway ... as long as it works ...

Regards


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Excel 2007 won't print to... Import .txt to Access 200...


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Link tab name to cell

Excel Tab name copying www.computing.net/answers/office/excel-tab-name-copying/1017.html

Excel combo box link to cell www.computing.net/answers/office/excel-combo-box-link-to-cell/7702.html

change tab names in excel formula www.computing.net/answers/office/change-tab-names-in-excel-formula/8225.html