#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Hyperlink box color

In Microsoft excel 2007 I have spreadsheet with hyperlinks to another page
and I would like the hyperlinked cell to be highlighted when I click on the
link. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default Hyperlink box color

Do you mean you want to highlight the cell the hyperlink jumps to? Try the
following event code...

Option Explicit

Public PrevCell As Range

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
On Error Resume Next
Dim c As Range
If Target.Hyperlinks.Count 0 Then
Set c = Range(Target.Hyperlinks(1).Range)
c.Interior.ColorIndex = 6
PrevCell.Interior.ColorIndex = xlColorIndexNone
Set PrevCell = c
End If
End Sub

I used ColorIndex 6, which is bright yellow. Change it to whatever you like.

This code needs to be pasted into the ThisWorkbook module of your workbook
in the Visual Basic Editor. If you are new to macros, this link to Jon
Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"Laurie@mtb" wrote:

In Microsoft excel 2007 I have spreadsheet with hyperlinks to another page
and I would like the hyperlinked cell to be highlighted when I click on the
link. Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Followed Hyperlink Font Color mustang25 Excel Discussion (Misc queries) 3 November 26th 07 10:17 PM
Can't make hyperlink function work for hyperlink to website Frank B Denman Excel Worksheet Functions 15 February 5th 07 11:01 PM
Can I remove a hyperlink without removing the color of the cell? wendy Excel Discussion (Misc queries) 1 April 13th 06 05:02 PM
How do you change the color of a hyperlink after you click on it? Husker87 Excel Worksheet Functions 1 June 11th 05 06:07 PM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"