Here is a sample spreadsheet

I want to select a range (ex: A2:E2) and get the value 1. If I select A4:E4 I will get the value 1; and so on. Is there any way to achieve this with a macro?
Another thing I would need is the value in the first row of the corresponding column. Ex:
If I select A2:E2 I want to get n (since 1 is in column E), if I select A4:E4 I want to get v (since 1 is in column C).
Ok, here is a function which you can use as a formula in the workbook. It also addresses both your questions. 🙂
Paste the below code in a module.
SYNTAX/USAGE
=MyFunc(Cell Range, Arg)
Cell Range: (Required) A range such as A2:E2
Arg: (Required) Can take a value of “H” Or “R”. “H” will give you the column Header and “R” will give you the row value
Example
=MyFunc(A1:E2,”H”) will give you “n” AND
=MyFunc(A1:E2,”R”) will give you “1”
Note: This is just a general code to show you how it works and it doesn’t handle any errors at the moment.