SOLVED

Hyperlinked cell - auto change colour

Brass Contributor

Hi, when i attach a hyperlink to a cell, i want it to auto change colour. I have used Conditional Formatting for "No Blank", but this works with any text - i want the cell to only format when a Hyperlink is attached to it. I would really appreciate some help.

Thanks in advance all.

4 Replies

In your workbook create a VBA module. Add the following code to it:

 

Function IsHyperlink(Cell As Range) As Boolean
  If Cell.Hyperlinks.Count > 0 Then
  IsHyperlink = True
  Else: IsHyperlink = False
  End If
End Function

 

Use this IsHyperlink function in your Conditional Formatting  

 

 

best response confirmed by PHILIP ROCHESTER (Brass Contributor)
Solution

A hyperlink has a format, in the same way that headings are formats. Assuming you're using a version with a ribbon; start from your hyperlinked cell, click the Home ribbon tab, then cell styles. In the second section, "Data and Model," you will see the Hyperlink style. Right-click on it, and you can edit the style to be as you want.

 

Thanks, now i see it - it is easy!
Thanks Michael
Thanks for the reply Kenton
1 best response

Accepted Solutions
best response confirmed by PHILIP ROCHESTER (Brass Contributor)
Solution

A hyperlink has a format, in the same way that headings are formats. Assuming you're using a version with a ribbon; start from your hyperlinked cell, click the Home ribbon tab, then cell styles. In the second section, "Data and Model," you will see the Hyperlink style. Right-click on it, and you can edit the style to be as you want.

 

View solution in original post