Worksheet Functions

  • Thread starter Thread starter alistre
  • Start date Start date
A

alistre

I am trying to codify Excel's Match function in VBA. Somewhere I have
a syntax error. I cannot figure it out. I am just learning about the
"Application.WorksheetFunction" syntax. Can you help me with writing
the Match argument?

Range("A10") =
Application.WorksheetFunction.Match(Range("L8").Text,Range("A1:A550"),0)
 
Hi Alistre,

Try:

Dim Res As Variant

Res = Application. _
Match(Range("L8").Value, Range("A1:A550"), 0)
Range("A10").Value = Res
 
Thanks a lot. That worked perfect. I'm curious why the
"Application.WorksheetFunction" part was shortened to "Application".
Also, although the code worked, VBA didn't seem to recognize that
"Match" could follow "Application" when I tried to use Complete Word.
Do you know either answer? Thanks again.
 
Hi Alistre,
or perform a google groups search using Ttappale error and
WorksheetFuntion
as keys.

Turning on the light while I type:

or perform a google groups search using 'Trappable error' and
'WorksheetFuntion'
as keys.
 
Hi Alistre,

See also Tom Ogilvy's response in your 'Using Excel functions in VBA'
thread.
 

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

Back
Top