MAX of ABS of 2 values syntax

  • Thread starter Thread starter u473
  • Start date Start date
U

u473

Would this syntax be correct ?

Var1 = WorksheetFunction.Max(WorksheetFunction.Abs
(Rng1),WorksheetFunction.Abs(Rng2))
Thank you for your help,
J.P.
 
JP,

If you have only one cell in each range, then use

Var1 = Application.WorksheetFunction.Max(Abs(rng1.Value), Abs(rng2.Value))

VBA has its own ABS function, so the worksheetfunction is not needed in that case.

HTH,
Bernie
MS Excel MVP
 
That won't work, try this

Var1 = Evaluate("MAX(ABS(" & rng1.Address & "),ABS(" & rng2.Address &
"))")
 

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