• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need Help: Need to Highlighting correlating row

Kansas10

New Member
I am needing help!. How do I get the active row that i am working in (Row 3) to highlight along with the correlating row with the values (Row 16).?
 

Attachments

  • Doc2.pdf
    178.9 KB · Views: 0
Hi Kansas, and welcome to the forum. :awesome:

In the future, it's more helpful if you can upload an XL file we can work with immeidately, rather than an image that we'll have to recreate something from.

As for your question, the only way to detect the active cell would be by using a macro. Is this ok? If yes, right-click on the sheet tab, view code, paste this in
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim curCell As Range
Dim fCell As Range

'Check if we're in the range of interest
If Intersect(Target, Range("3:12")) Is Nothing Then Exit Sub

Set curCell = ActiveCell
Set fCell = Range("C:C").Find(Cells(ActiveCell.Row, "A").Value)

'Check if value in col A found in table below
If fCell Is Nothing Then Exit Sub
Application.EnableEvents = False
Union(ActiveCell.EntireRow, fCell.EntireRow).Select
curCell.Activate
Application.EnableEvents = True
End Sub
Close the Visual Basic Editor, and you should be good to go.
 
This line is what does that work
Code:
Set fCell = Range("C:C").Find(Cells(ActiveCell.Row, "A").Value)
It says to search col C for the value found in col A of the active cell's row. So, it doesn't matter whether col A has the letter a, b, c, d, etc.
 
Back
Top