Need help referencing highlighted cells in a dataset

RockyV8907

New Member
Joined
Jul 10, 2013
Messages
1
199419951996199719981999200020012002200320042005200620072008200920102011201220132014
696917311211

<tbody>
</tbody>

:rolleyes::oops:
=INDIRECT(ADDRESS(1,MATCH(1000,B2:V2)+1))

I have a dataset with over a 1000 rows.:eek: I just pulled one row in my dataset as an example. My formula above finds the last cell with a value in the 2 row, finds the year associated with it in the first row, and pulls the year from the first row. What I need help with is trying find the last value highlighted red and pulling the year associated with it in the first row. I can't seem to figure out a solution :confused: and would very much appreciate any input or advice.

Thank you SO much for your assistance!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi Rocky. Try:
Code:
Sub Test()
    Application.ScreenUpdating = False
    Dim x As Long
    Dim c As Range
    Dim lCol As Long
    For x = 2 To ActiveSheet.UsedRange.Rows.Count
        lCol = Range("IV" & x).End(xlToLeft).Column
        For Each c In Range(Cells(x, 1), Cells(x, lCol))
            If c.Font.ColorIndex = 3 And c.Offset(0, 1).Font.ColorIndex <> 3 Then
                MsgBox ("The year associated with row " & c.Row & " is " & Cells(1, c.Column))
            End If
        Next c
    Next x
    Application.ScreenUpdating = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,297
Messages
6,129,954
Members
449,544
Latest member
Akhil333

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top