Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default 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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Referring to first cell in a range FARAZ QURESHI Excel Discussion (Misc queries) 5 December 26th 07 05:14 PM
Referring to a named range Darin Kramer Excel Programming 2 March 1st 07 05:26 PM
Referring to cells in a filtered range Stefi Excel Programming 5 October 27th 05 10:48 AM
referring to a range Kevin Smith[_3_] Excel Programming 2 September 7th 04 12:24 PM
problem referring to Range and Cells Kevin Excel Programming 8 February 28th 04 01:05 AM


All times are GMT +1. The time now is 11:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"