Find the first Value in a Row and Retrieve the Header for That Column

E

efernandes67

Hi,

I need some help solve this problem.
Supose I have the array as in the file in attach.

I want to:
1) find the first value in the range A9:L9 (result: "1")
2) retrieve header for that column (result: "i")
3) find the next value in the range A9:L9 (result: "8")
2) retrieve header for that column (result: "l")

Best Regards,
Eli

+-------------------------------------------------------------------
|Filename: FirstValueInaRow.pdf
|Download: http://www.excelforum.com/attachment.php?postid=4240
+-------------------------------------------------------------------
 
J

Jim May

In a standard module paste in:

Sub Foo()
Set Rng = Range("A9:L9")
For Each c In Rng
If c.Value = 1 Or c.Value = 8 Then
MsgBox "Your Header name is " & c.Offset(-8, 0).Value ' assumes your heade
Row = 1
End If
Next c
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top