Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Highlighted cell if another cell on the same row has hyperlink.

0

Dear Sirs,

In the attached file , I highlighted cell  with a yellow background if another cells next to it on the same row has hyperlink manually.(i.e B2 with a yellow background if A2 has hyperlink).

I need help in repeating the same purpose to another cell by using macros (Vba) to prevent the repetitive action manually on other cells in the existing dynamic range of data.

Looking forward to having the help in this regards

Many thanks and best regards

Arsil Hadjar

Answer
Discuss

Answers

1
Selected Answer

Hi,

Please change range as per requirement,

Sub Hyperlink_Selection()
    Dim Rng As Range
    For Each Rng In Range("A3:A383")
        If Rng.Hyperlinks.Count > 0 Then
            Rng.Offset(0, 1).Interior.Color = vbYellow
        End If
    Next
End Sub
Discuss

Discussion

Dear Anand,

Many thanks for the help. It works

Best regards
Arsil Hadjar
Arsil (rep: 32) May 22, '19 at 8:02 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login