View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
franciz franciz is offline
external usenet poster
 
Posts: 79
Default worksheetfunction.match

Try using

Application.WorksheetFunction _
.Match(19031, Worksheets("drawing").Range("Trange"), 0)

If you use a worksheet function that requires a range reference as an
argument, you must specify a Range object.

regards,


"Li Jianyong" wrote:


I am trying to use worksheetfunction.match to get the data postion in a
range named sheets("drawing").range("G2:G235")

the code is

Dim R as long
Dim Trange as range

Set Trange=sheets("drawing").range("G2:G235")

R=application.worksheetfunction.match( 19031,Trange,0)

Msgbox R
....



I am sure the no. 19031 mentioned above are in the range. But when I run
this program, it appears err.number 1004. I can not get the R value

please provide help. thanks

Li Jianyong