Dear Forum Members,
I am looking for the VBA code to write hyperlinks to multiple worksheets in a Excel 2010 workbook. The hyperlink must be placed in cell H1 of each worksheet. These hyperlinks must all link back to a "dashboard" worksheet. Thanks
Dear Forum Members,
I am looking for the VBA code to write hyperlinks to multiple worksheets in a Excel 2010 workbook. The hyperlink must be placed in cell H1 of each worksheet. These hyperlinks must all link back to a "dashboard" worksheet. Thanks
Something like this?
![]()
Sub AddHyperlink() Dim s As Worksheet For Each s In ActiveWorkbook.Sheets If s.Name <> "Dashboard" Then s.Range("H1").Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Dashboard!A1", TextToDisplay:="Dashboard" End If Next s End Sub
Actually more like this.
![]()
Sub AddHyperlink() Dim s As Worksheet Application.ScreenUpdating = False For Each s In ActiveWorkbook.Sheets If s.Name <> "Dashboard" Then s.Activate s.Range("H1").Select s.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Dashboard!A1", TextToDisplay:="Dashboard" End If Next s Application.ScreenUpdating = True End Sub
Dear foundy,
No doubt this was very easy for you, so perhaps my gratitude will seem affected, but I would be remiss if I didn't tell you that this 'little' piece of code is fantastic! Thank you very much indeed!
Dear Foundy,
I'm curious about why you disable screen updating for the loop. Does this make the makro faster?
Glad to help![]()
Hi,
Yes it speeds up the macro, it also stops the screen flicking from sheet to sheet as it adds the hyperlinks.
Hello dover.jackiek,
I had this sample Workbook I wanted to send you yesterday, but we had to content with a power outage for a couple of hours.
foundy offered you some great assistance, but for what it may be worth to you, feel free to have a look at the attached sample.
Instead of referring to a "Dasboard" Sheet, the Code uses "Sheet1". Hyperlinks are created in H3 of each other Sheet instead if H1. You may change all these differences to suit.
If our contributions take care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
Also, since you are relatively new to the forum, I would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which you have been helped. This adds to the reputation of the person who has taken the time to help you.
Thanks.
Please consider:
Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
Dear Winon,
Thanks for the additional spreadsheet and the advice. There is nothing I would like more than to perform the tasks that you suggested to express my gratitude but there are a few problems:
1) When I click on the login to see the answer to my question I get taken to a set of pages listing hundreds of posts and the post I am looking for is simply not there. Getting back to the post is a mission, to say the least, which was the problem I originally complained about.
2) I cannot find any "Menu" item, nor any star icon of any nature or description.
If you can show me the shortcut keys to use the forum I will certainly do so - but at the moment I am getting nowhere. Once again, thank you very much for the additional spreadsheet.
Hello dover.jackiek,
Thank you for the feedback.
You are welcome.
Just click on the link as it appears in your email inbox, and that will take you to your post in the Forum.Getting back to the post is a mission, to say the least,...
As for the remaining issues, I see that you were smart enough to sort it out yourself!
Thank you for adding to my Reputation, much appreciated.
Regards.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks