Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Functions like MIN(), MAX(), SMALL()..

It is too bothersome for me to write codes for functions above(and much more) and do the trick.

Any help?

share|improve this question

You can use the following code to use worksheet functions in VBA.

share|improve this answer

No need for user defined codes. You can use

  • many WorkSheet functions directly
  • Use Evaluate as a workaround

    MsgBox Application.WorksheetFunction.Min(Range("A1:A10"))
    MsgBox Evaluate("=SMALL(A1:A10,2)")

share|improve this answer
@Excellll - thx for that. I tried but couldn't get it working (!) yesterday. I've never had this issue at SO. – brettdj Sep 13 '12 at 23:16
My SO and SU activity blends together since I mostly stick to the Excel stuff, but I've run into problem with numbered lists and code blocks before on one or the other. I had to use <code> tags, and as you can see, it's still not perfect. – Excellll Sep 13 '12 at 23:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.