Reset Followed Hyperlinks

D

Donny

I've created a Jeopardy game, and the cells that have the dollar
values are hyperlinked to another sheet with that specific answer in
it. I've edited the style of followed hyperlinks to be blue,
basically blank after followed. At the end of the game, or anytime
for that matter, I would like to have a macro that resets the followed
hyperlinks back to their original "un"followed color.

Also, if anyone knows where I could post this file once completed, I
believe it may work well for others. I've found similar Jeopardys as
powerpoints and such, but this one uses buttons and calculates score
totals for each player. The only thing it lacks is Daily Doubles
popups and answers, but i'm sure someone can fill that in.

Thanks-
 
C

CurlyDave

Here's a code found at AllExperts, the expert being Damon
Ostrander......

Sub RefreshHlinks()

'Refreshes all hyperlinks on the active worksheet

Dim Hcount As Integer
Dim CellLoc() As Range
Dim HlinkAddress() As String
Dim HlinkSubAddress() As String
Dim i As Integer

With ActiveSheet.Hyperlinks

Hcount = .Count
ReDim CellLoc(Hcount)
ReDim HlinkAddress(Hcount)
ReDim HlinkSubAddress(Hcount)

'Save hyperlink addresses
For i = 1 To Hcount
Set CellLoc(i) = .Item(i).Range
HlinkAddress(i) = .Item(i).Address
HlinkSubAddress(i) = .Item(i).SubAddress
Next i

..Delete 'deletes all hyperlinks on sheet

'Restore all hyperlinks
For i = 1 To Hcount
If HlinkSubAddress(i) = "" Then
..Add CellLoc(i), HlinkAddress(i)
Else
..Add CellLoc(i), HlinkAddress(i), HlinkSubAddress(i)
End If
Next i
End With

End Sub
 
C

CurlyDave

Also, if anyone knows where I could post this file once completed, I
believe it may work well for others.  I've found similar Jeopardys as
powerpoints and such, but this one uses buttons and calculates score
totals for each player.  The only thing it lacks is Daily Doubles
popups and answers, but i'm sure someone can fill that in.
I see you are on Gmail,
You can create your own google site and store files on it, then attach
a link to the file in your post, for example.

Here is a link the the WorkBook RefreshHyperlinks
http://sites.google.com/site/davesexcel/Home/forum-examples/RefreshHyperLink.xls?attredirects=0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top