ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Referring first row in range (https://www.excelbanter.com/excel-programming/398621-referring-first-row-range.html)

Asif

Referring first row in range
 
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.

--
Thanx & regards,
Asif

Alan Beban[_2_]

Referring first row in range
 
What is the address of Range("col_cp")?

Alan Beban

Asif wrote:
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.


Asif

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

--
Thanx & regards,
Asif


"Alan Beban" wrote:

What is the address of Range("col_cp")?

Alan Beban

Asif wrote:
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.



Alan Beban[_2_]

Referring first row in range
 
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

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


Gary Keramidas

Referring first row in range
 
range("test").Range("A1").Row

--


Gary


"Asif" wrote in message
...
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.

--
Thanx & regards,
Asif





All times are GMT +1. The time now is 04:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com