Forum Discussion
Hyperlinked cell - auto change colour
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.
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.
4 Replies
- Michael LivingInfoCopper Contributor
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.
- PHILIP ROCHESTERBrass ContributorThanks, now i see it - it is easy!
Thanks Michael
- Kenton SmithCopper Contributor
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 FunctionUse this IsHyperlink function in your Conditional Formatting
- PHILIP ROCHESTERBrass ContributorThanks for the reply Kenton