Forum Discussion

PHILIP ROCHESTER's avatar
PHILIP ROCHESTER
Brass Contributor
Aug 13, 2018
Solved

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

  • 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.

     

  • Kenton Smith's avatar
    Kenton Smith
    Copper 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 Function

     

    Use this IsHyperlink function in your Conditional Formatting  

     

     

Resources