Referring first row in range

A

Asif

I need to refer to top row of named range.

..Value = Range("col_CP")(0, 0) _
..Offset(WorksheetFunction.Match("Client", Range("col_CP"), 0), 2)

I'm getting Runtime error 1004: Method 'Range' of object '_Worksheet' failed

I'd appreciate if somebody could help me getting this code right.
 
A

Asif

It's in different sheet, Data. The named range is N31:N45. I want to pick the
value from column O.
 
A

Alan Beban

Sheets("Data").Range("col_cp")(1, 1).Offset(0, 1).Value

will return the value of the cell to the right of the top cell of col_cp.

Alan Beban
 

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