Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default MAX of ABS of 2 values syntax

Would this syntax be correct ?

Var1 = WorksheetFunction.Max(WorksheetFunction.Abs
(Rng1),WorksheetFunction.Abs(Rng2))
Thank you for your help,
J.P.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default MAX of ABS of 2 values syntax

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


"u473" wrote in message
...
Would this syntax be correct ?

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default MAX of ABS of 2 values syntax

That won't work, try this

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


--
__________________________________
HTH

Bob

"u473" wrote in message
...
Would this syntax be correct ?

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default MAX of ABS of 2 values syntax

Thank you both.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax HELP Eric H Excel Discussion (Misc queries) 4 August 30th 08 01:30 AM
Paste Special Values Syntax L. Howard Kittle Excel Programming 2 March 16th 06 09:02 PM
Passing Values Syntax Chuck Taylor Excel Programming 3 January 12th 04 04:38 PM
paste as values syntax Jerry[_14_] Excel Programming 1 November 3rd 03 02:58 AM
VBA Syntax for VLOOKUP to return array of return values Alan Beban[_3_] Excel Programming 7 August 5th 03 11:41 AM


All times are GMT +1. The time now is 08:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"