View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Find variable with the highest value

You can do call out to the worksheet's MAX function...

MaxVal = WorksheetFunction.Max(Int1, Int2, Int3, Int4, Int5)

--
Rick (MVP - Excel)


"MJKelly" wrote in message
...
Hi, I have 5 variables containing integers. How can I use vba to
identify the variable with the highest value?

Thanks
Matt