View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Jon Peltier question: use of MATCH

Hi Bryan,

test_variable = MATCH(39000,B2:B8,1)


Try,

test_variable = Application.Match(39000, Range("B2:B8"), 1)

In Excel you can refer to the range as B2:B8, but in VBA you need to
explicitly use a range object and enclose the A1-style address between
quotes.


---
Regards,
Norman

"Bryan Kelly" wrote in message
...
I am trying to use the match command. From the Excel help file I built

this
line of code

test_variable = MATCH(39000,B2:B8,1)

I added "test_variable =" to what I copied from the Excell file.
Excel does not like the colon between the B2 and B8 saying it wants a
separator.

The line from Jon's original note was
Name: ET
Refers To: =MATCH("Elapsed Time",Sheet1!$1:$1,0)



Excel doesn't like either one. How do I get this match to work?

--
Bryan Kelly
Time is the medium we use to express out priorities.