LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Application.Worksheetfunction.Sumproduct

Hi all,

I have got this groovy formula below as an Excel formula and would like to
make it usable as VBA:

=SUMPRODUCT(--(B3:B16-B2:B15=0),B3:B16-B2:B15)

I realised this "-" in the formula means "multiply by -1".

I tried:

Dim v As Variant
v = Application.WorksheetFunction.SumProduct(--(Range("B3:b16") -
Range("b2:b15") = 0), Range("B3:b16") - Range("b2:b15"))

But I get Type Mismatch error...

Can anyone help?

Thanks in advance,
Tetsuya

 
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
Need help with Application.WorksheetFunction Ayo Excel Discussion (Misc queries) 4 May 14th 08 11:13 PM
Application.WorksheetFunction.VLookup (Plz Help) Raj[_11_] Excel Programming 4 July 4th 07 01:37 PM
application.worksheetfunction Ozgur Pars[_2_] Excel Programming 4 July 18th 06 08:11 AM
Application.worksheetfunction Terry V Excel Programming 7 October 12th 04 05:48 AM
Using Application.WorksheetFunction.Ln(...) in VBA doco Excel Programming 4 August 25th 03 01:08 PM


All times are GMT +1. The time now is 03:00 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"