Thread: MIN in VBA?
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default MIN in VBA?

"Mike" wrote:
What is MIN in VBA?
Say you have this: PM=MIN(ab,cd) (minimum of ab and cd)
How do you write it in VBA?


There is no Min function in VBA. You use WorksheetFunction.Min; that would
certainly make sense if you have some Ranges or arrays. But if ab and cd
are simple variables, I think the following is best:

PM = IIf(ab<=cd,ab,cd)