Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers 2

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

Application.WorksheetFunction.SMALL(....)
share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.