LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
aw aw is offline
external usenet poster
 
Posts: 19
Default function "sumproduct" in VBA environment

Dear Sir / Madam,

Could anyone can help to translate the worksheet function sumproduct (as
below) into VBA??


=SUMPRODUCT(--(yard="BSHKY"),--(ac_name="Yard Trucks"),amt)

Remark : Yard, ac_name & amt are pre-defined range.


My working as follow : (but run-time error 13 type mismatch appear)

Sub sp()
a = InputBox("Yard")
b = InputBox("A/C name")
MyAns = Application.WorksheetFunction.SumProduct((Range("y ard") = "a"),
(Range("ac_name") = "b"), Range("amt"))
End Sub

!!!Thank you so much!!!

Best rgds // aw

--
aw
 
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
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
nesting "and" in sumproduct function George P Excel Discussion (Misc queries) 1 January 6th 07 07:40 PM
nesting "and" in sumproduct function George P Excel Discussion (Misc queries) 0 January 6th 07 07:22 PM
Please add a "sheet" function like "row" and "column" functions Spreadsheet Monkey Excel Programming 2 November 8th 05 04:08 PM
Set Focus in "Form" environment Tom Ogilvy Excel Programming 0 September 4th 03 05:55 PM


All times are GMT +1. The time now is 07:28 AM.

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

About Us

"It's about Microsoft Excel"